Browse[1]> j <- c(1,2,NA) Browse[1]> j[j==1][-1] [1] NA Browse[1]> j[j==1][-2] [1] 1 Browse[1]> j[j==1][-2] <- 2 Error during wrapup: NAs are not allowed in subscripted assignments
As far as I can see, I have no NA in the lhs (not after the second subscript anyway). Besides, I have a single value on the rhs, so it should be allowed to have NAs in the lhs, according to help(Extract). What am I missing? I can see no ambiguite as to what the result of those commands should be (j == c(2,2,NA)). -- Med venlig hilsen Rune Schjellerup Philosof Videnskabelig Assistent, Statistik, SDU Telefon: 6550 3607 Email: rphilo...@health.sdu.dk Adresse: J.B. Winsløwsvej 9, 5000 Odense C ______________________________________________ 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.