[R] bug in cor (..., use= ...)?

Lorenz.Gygax@fat.admin.ch Lorenz.Gygax at fat.admin.ch
Mon May 24 08:56:44 CEST 2004


Dear R users,

I have not found anything on this in the archives. Does anyone know whehther
the parameter use= is not functioning in cor or enlighten me what it is
supposed to do?

My R version is "R version 1.8.1, 2003-11-21" on Windows 2000. I am hoping
to be able to update to 1.9.1 as soon as it has appeared (we are not allowed
here to install software on our own and thus I am trying to be able to have
the .1 versions installed ...).

Test code:

x <- 1:10
y <- 2:11

x [1] <- NA
y [10] <- 12

cor (x, y, use= 'all.obs', method= 'kendall')
cor (x, y, use= 'complete.obs', method= 'kendall')
cor (x, y, use= 'pairwise.complete.obs', method= 'kendall')

As I understand, the first one of this should result in an error which it
does not. All the results are the same and seemingly treat the NA as if it
was 0.

Any ideas are appreciated.

Thanks and regards, Lorenz
- 
Lorenz Gygax, Dr. sc. nat.
Tel: +41 (0)52 368 33 84 / lorenz.gygax at fat.admin.ch      

Tag der offenen Tür, 11./12. Juni 2004: http://www.fat.ch/2004

Center for proper housing of ruminants and pigs
Swiss Veterinary Office
agroscope FAT Tänikon, CH-8356 Ettenhausen / Switzerland
Fax : +41 (0)52 365 11 90 / Tel: +41 (0)52 368 31 31




More information about the R-help mailing list