Re: [Rd] R 2.5.1 - ?factor examples, details

2007-07-03 Thread Peter Dalgaard
François Pinard wrote: > Hi, R people. > > In ?factor, in the "Examples:" section, we see: > > ## suppose you want "NA" as a level, and to allowing missing values. > (x <- factor(c(1, 2, "NA"), exclude = "")) > is.na(x)[2] <- TRUE > x # [1] 1 NA, used because NA is a level. > is.na(

[Rd] R 2.5.1 - ?factor examples, details

2007-07-02 Thread François Pinard
Hi, R people. In ?factor, in the "Examples:" section, we see: ## suppose you want "NA" as a level, and to allowing missing values. (x <- factor(c(1, 2, "NA"), exclude = "")) is.na(x)[2] <- TRUE x # [1] 1 NA, used because NA is a level. is.na(x) # [1] FALSE TRUE FALSE I'm a bit