Skip to content
Prev 295938 / 398503 Next

correlation matrix only if enough non-NA values

Hello,

Instead of 'sum' use 'mean'

ok <- apply(tbl, 2, function(x) mean(!is.na(x)) >= 0.5)
cor(tbl[, ok], use="pairwise.complete.obs")

Hope this helps,

Rui Barradas

Em 29-05-2012 10:03, jeff6868 escreveu: