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

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -