I'm running cor() on a data.framewith all numeric values and I'm getting this as the result:
cor()
data.frame
price exprice... price 1 NA exprice NA 1 ...
So it's either 1 or NA for each value in the resulting table. Why are the NAs showing up instead of valid correlations?
1
NA
Tell the correlation to ignore the NAs with use argument, e.g.:
use
cor(data$price, data$exprice, use = "complete.obs")
2.1m questions
2.1m answers
60 comments
57.0k users