From mayeul.kauffmann at tiscali.fr  Thu Sep 16 01:23:09 2004
From: mayeul.kauffmann at tiscali.fr (Mayeul KAUFFMANN)
Date: Thu Sep 16 01:23:28 2004
Subject: [Rd] cor() fails with big dataframe
Message-ID: <000501c49b7a$fafebb50$ce979a53@amd>

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


[Rd] cor() fails with big dataframe
Mayeul KAUFFMANN