I want a mean vector of the iris dataset such that the first element in the vector is the mean of the first column, the second is the mean of the second column etc..
My code is:
data("iris")
mean(iris[,1:4])
I get the message:
Warning message:
In mean.default(iris[, 1:4]) :
argument is not numeric or logical: returning NA
If I try to calculate the mean of each collumn with mean(iris[,1]), mean(iris[,2])... I have no problem but if I do the mean(iris[,1:4]) it returns NA