R - mean function warning 'argument is not numeric or logical' -


having problem in r. following works fine

na.omit(data)["ozone" > 31 | "temp" > 90]["solar.r"] 

and returns

      solar.r 1       190 2       118 3       149 4       313 7       299 8        99 9        19 12      256 13      290 14      274 15       65 16      334 17      307 18       78 

however, if pass mean function

mean(na.omit(data)["ozone" > 31 | "temp" > 90]["solar.r"]) 

the result is, well, not nice (pun!)

[1] na warning message: in mean.default(na.omit(data)["ozone" > 31 | "temp" > 90]["solar.r"]) :   argument not numeric or logical: returning na 

any idea going wrong? puns more welcome!


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -