Dear R-Help,

 

I have used R2.6.0 until I recently installed also R2.7.2 (see details below)

 

In R 2.6.0, the following script using the function 'var' (cor(stats)):

 

x.test <- c(NA, NA, NA, NA)

var(x.test, na.rm=T)        

 

gives the output: 

 

NA

 

In R2.7.2 the output of the same script generates an error message and stops R:

 

 'Error in var(x.test, na.rm = T) : no complete element pairs'

 

R2.7.2 can handle it if there is just one non-NA value in the list but not if 
they are all NA.

 

I prefer the output of 2.6.0. Is this a bug in 2.7.2 or is it a deliberate 
change compare to previous versions? Or is there a way to make R2.7.2 give NA 
as output?

 

Thank you for any helo/comments!

 

Best regards,

 

Klaus

 

Details on R versions installed and platform:

Platform: Windows XP Prof, English, ver. 5.1

R2.6.0:

"LC_COLLATE=Danish_Denmark.1252;LC_CTYPE=Danish_Denmark.1252;LC_MONETARY=Danish_Denmark.1252;LC_NUMERIC=C;LC_TIME=Danish_Denmark.1252"

R2.7.2:

"LC_COLLATE=Danish_Denmark.1252;LC_CTYPE=Danish_Denmark.1252;LC_MONETARY=Danish_Denmark.1252;LC_NUMERIC=C;LC_TIME=Danish_Denmark.1252"

 

Klaus Steenberg Larsen
Scientist
Phone direct +45 4677 4157
[EMAIL PROTECTED]
 

Biosystems Division
Risø National Lab. for sustainable Energy
Risø DTU
Building 309, P.O. Box 49
DK-4000 Roskilde, Denmark
Tel +45 4677 4100
Fax +45 4677 4160
www.risoe.dk 

>From 1 January 2007, Risø National Laboratory, the Danish Institute for Food 
>and Veterinary Research,
the Danish Institute for Fisheries Research, the Danish National Space Center 
and
the Danish Transport Research Institute have been merged with
the Technical University of Denmark (DTU) with DTU as the continuing unit.













 


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to