r - Problems with "complete.obs" in correlation -
i've got problem cor() function in r, here's data df:
b c d e 1 0 0.00000000 17.0 16.90 5.039439 2 0 0.00000000 20.5 18.35 4.974208 3 0 0.00000000 25.0 25.00 2.158227 4 0 0.00000000 19.1 19.05 4.317257 5 0 0.00000000 21.0 20.90 3.853504 6 0 0.00000000 20.0 19.15 5.408093 7 0 0.00000000 17.4 17.40 5.375745 8 1 0.08053691 na na na 9 0 0.00000000 18.0 18.00 2.767346 when try calculate:
cor(df$a,df$c,use="complete.obs") i error:
standard deviation 0 but have absolutely no clue why it's not working, becuase acutally row #8 should excluded because of na, shouldn't it?
thank you!
Comments
Post a Comment