R newbie here. I have tried most solutions on SO but they haven't worked for me. This is a sample from my dataframe:
l m n o p q r m.mean
1 2011-04-11T07:08:39+00:00 229 NULL 64a1a092-7e85-4744-b266-4396aab12259 FALSE NULL Visa ****9999 NA
2 2005-11-02T11:32:56+00:00 351 NULL e6e7f646-685a-4385-8d9f-630f48166513 FALSE NULL Visa ****9999 NA
3 2010-10-10T07:12:25+00:00 28 NULL 6110c469-e49f-4c2a-8fca-acb03026adad FALSE NULL Visa ****9999 NA
I am trying to use colMeans(ts1[,"m"])
but it returns
Error in colMeans(ts1[, "m"]) :
'x' must be an array of at least two dimensions
How do I fetch the column mean in this case?
I have tried creating a list out of the column and then fetching its mean but that approach hasn't worked either.
Also, doing str(dataframe)
reveals all values in the "m" column are num
UPDATE 1
Doing
colMeans(ts1[,"m"],drop=FALSE)
results in errorError in colMeans(ts1[, "m"], drop = FALSE) : unused argument (drop = FALSE)
Doing
mean(ts[,"m"])
results in errorWarning message: In mean.default(ts[, "m"]) : argument is not numeric or logical: returning NA