September 2018
Beginner
206 pages
4h 27m
English
Herein, we will utilize the apply() function to summarize a dataset. In order to so, the following steps have to be executed:
data("iris")
apply(iris[,-c(5)], 2, FUN = mean)
apply(iris[,-c(5)], 2, function(x) c(mean(x), var(x)))
apply(iris[,-c(5)], 1, FUN = mean)
Output: The following is the output we get as we execute the code mentioned ...