Full_Name: Richard Single Version: 1.5.1 OS: Windows Submission from: (NULL) (132.198.176.82) In the latest Windows version the following syntax behaves differently than it did in version 1.4.0: x[x!="NA"] The results under R 1.4.0 agree with S. --Rich R 1.4.0> x <- c(NA, 2, 3, NA) > x == "NA"[1] TRUE FALSE FALSE TRUE> is.na(x)[1] TRUE FALSE FALSE TRUE R 1.5.1> x <- c(NA, 2, 3, NA) > x == "NA"[1] NA FALSE FALSE NA> is.na(x)[1] TRUE FALSE FALSE TRUE -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 27 Aug 2002 rsingle@zoo.uvm.edu wrote:> Full_Name: Richard Single > Version: 1.5.1 > OS: Windows > Submission from: (NULL) (132.198.176.82) > > > In the latest Windows version the following syntax behaves > differently than it did in version 1.4.0: x[x!="NA"] > The results under R 1.4.0 agree with S.Yes. It's a deliberate change in 1.5.0, documented in both the NEWS file and the guide to updating to 1.5. The string "NA" is not special any more, you need as.character(NA) to make a missing string, and you need to use is.na() to test for NAs, as was always recommended. -thomas> --Rich > > R 1.4.0 > > x <- c(NA, 2, 3, NA) > > x == "NA" > [1] TRUE FALSE FALSE TRUE > > is.na(x) > [1] TRUE FALSE FALSE TRUE > > > R 1.5.1 > > x <- c(NA, 2, 3, NA) > > x == "NA" > [1] NA FALSE FALSE NA > > is.na(x) > [1] TRUE FALSE FALSE TRUE > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >Thomas Lumley Asst. Professor, Biostatistics tlumley@u.washington.edu University of Washington, Seattle ^^^^^^^^^^^^^^^^^^^^^^^^ - NOTE NEW EMAIL ADDRESS -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
This is correct: see the NEWS file. Working as documented is not a bug. On Tue, 27 Aug 2002 rsingle@zoo.uvm.edu wrote:> Full_Name: Richard Single > Version: 1.5.1 > OS: Windows > Submission from: (NULL) (132.198.176.82) > > > In the latest Windows version the following syntax behaves > differently than it did in version 1.4.0: x[x!="NA"] > The results under R 1.4.0 agree with S. > > --Rich > > R 1.4.0 > > x <- c(NA, 2, 3, NA) > > x == "NA" > [1] TRUE FALSE FALSE TRUE > > is.na(x) > [1] TRUE FALSE FALSE TRUE > > > R 1.5.1 > > x <- c(NA, 2, 3, NA) > > x == "NA" > [1] NA FALSE FALSE NA > > is.na(x) > [1] TRUE FALSE FALSE TRUE > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._