Simon Fear <[EMAIL PROTECTED]> suggested that

        > a<-"a"
        > a<-NA
        > mode(a)
        [1] "logical"
        > a<-"a"
        > is.na(a) <- T
        > mode(a)
        [1] "character"

might be a relevant difference between assigning NA and using is.na.
But the analogy is flawed:  is.na(x) <- operates on the _elements_ of
x, while x <- affects the variable x.  When you assign NA to
_elements_ of a vector, the mode does not change:

    > a <- "a"  
    > is.na(a) <- TRUE
    > mode(a)
    [1] "character"
    > b <- "b"
    > b[TRUE] <- NA
    > mode(b)
    [1] "character"
    > c <- "c"
    > c[1] <- NA
    > mode(c)
    [1] "character"

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to