Which of the following code blocks can be used to summarize the data (finding the mean of the columns PetalLength and PetalWidth), similar to the one given below.
A. lapply(iris_data[, 3:4], mean)
B. sapply(iris_data[, 3:4], 2, mean)
C. apply(iris_data[, 3:4], 2, mean)
D. apply(iris_data[, 3:4], 1, mean)
Answer:A
Which of the following code blocks can be used to summarize the data (finding the mean of the columns PetalLength and PetalWidth), similar to the one given below.
A. lapply(iris_data[, 3:4], mean) B. sapply(iris_data[, 3:4], 2, mean) C. apply(iris_data[, 3:4], 2, mean) D. apply(iris_data[, 3:4], 1, mean)