I'm new to R and trying to do a simple ANOVA. I created a data frame:
MeanTable <- data.frame(Age=c("2","2","2","4","4","4","6","6","6"),
Yield=c("12.812","15.17","13.868","24.456","23.444","25.312",
"21.146","21.63","21.84"),stringsAsFactors = FALSE)
And then tried to do an ANOVA, but I got this warning message:
Warning messages: 1: In mean.default(X[[i]], ...) : argument is not numeric or logical: returning NA 2: In mean.default(X[[i]], ...) : argument is not numeric or logical: returning NA 3: In mean.default(X[[i]], ...) : argument is not numeric or logical: returning NA
So I assume that means I'm meant to use as.numeric to convert the values from factors into numbers. So I did this:
as.numeric(MeanTable$Age)
is.numeric(MeanTable$Age)
But got FALSE. What am I doing wrong? Or is my issue something else entirely?
MeanTable[] <- lapply(MeanTable, type.convert)but this can be avoided by not doing the quotes