Apply function in R

r

#1

Why does this simple piece of code giving an error?

apply(1:10,1,mean)

Error->
Error in apply(x, 1, mean) : dim(X) must have a positive length


#2

The first argument to the apply() function must be an array or a matrix (check the documentation).


#3

do this
??lapply to see list apply