. Advertisement .
..3..
. Advertisement .
..4..
I get an error
[1] NA
Warning message:
In mean.default(results) : argument is not numeric or logical: returning NA`
when trying to calculate mean (a data frame with two columns). How to fix the argument is not numeric or logical: returning na error? Please give me some advice.
The cause:
mean(<data.frame>)
is no longer available after R 3.0.0. If you pass a data.frame intomean
, the error you have will be displayed.Solution:
If your description is correct, then result will have two variables. Any of the following methods could be used to determine the column’s means:
You can also use this tool to find the meaning of a sentence.
You will get more information than you expected.
ex) Mininum value, 1st Qu., Median, Mean, 3rd Qu. Maxinum value, number NAs.
You can also use the below method to calculate the mean values for each column.
This will return the mean value. You will need to change the ‘columnName’ to your variable name