Skip to content
Back to formatted view

Raw Message

Message-ID: <000501c49b7a$fafebb50$ce979a53@amd>
Date: 2004-09-16T01:23:28Z
From: Mayeul Kauffmann
Subject: cor() fails with big dataframe

Hello,

I have a big dataframe with *NO* na's (9 columns, 293380 rows).

# doing
memory.limit(size = 1000000000)
cor(x)
#gives
Error in cor(x) : missing observations in cov/cor
In addition: Warning message:
NAs introduced by coercion

#I found the obvious workaround:
COR <- matrix(rep(0, 81),9,9)
for (i in 1:9) for (j in 1:9) {if (i>j) COR[i,j] <- cor (x[,i],x[,j])}
#which works fine, with no warning

#looks like a "cor()" bug.

#I checked absence of NA's by
x <- x[complete.cases(x),]
summary(x)
apply(x,2, function (x) (sum(is.na(x))))

#I use R 1.9.1

Cheers,
Mayeul KAUFFMANN
Universit? Pierre Mend?s France
Grenoble - France