I am an R beginner and having a hard time doing anything in it. I have a data set that originated from an excel file but is now a
In mean.default(results) : argument is not numeric or logical: returning NA
From R 3.0.0 onwards
mean(<data.frame>) is defunct (and passing a data.frame to
mean will give the error you state)
A data frame is a list of variables of the same number of rows with unique row names, given class "data.frame".
In your case, result has two variables (if your description is correct) . You could obtain the column means by using any of the following
lapply(results, mean, na.rm = TRUE) sapply(results, mean, na.rm = TRUE) colMeans(results, na.rm = TRUE)