[R] Missing Values from Spss-Data

Torsten Hothorn Torsten.Hothorn at rzmail.uni-erlangen.de
Thu Aug 23 10:01:42 CEST 2001


On Thu, 23 Aug 2001, C. Schulz wrote:

> Hello,
> i'm a newbie of the really fantastic "R" , but have some
> problems to define Missing Values from Spss-Files which i import
> with the read.spss(data) command !
> 
> What should i do to recode i.e. the values 9,99 & 999 to NA.
> Something like this
> 
> x <- c(9,99,999,NA)
> x==NA

is.na(x) is better and recoding can be done using

x[x == 9] <- NA, in summary

R> x <- c(9,99,999,NA) 
R> is.na(x)
[1] FALSE FALSE FALSE  TRUE
R> x[x == 9] <- NA
R> is.na(x)
[1]  TRUE FALSE FALSE  TRUE

Torsten

> 
> ...do  not what i want, because the data.frame show
> the values 9,99 & 999 and not NA in this fields ?
> 
> P.S. Perhaps is it easier to define all Missing Values in
> SPSS to
> SYSMIS so that i have got a blank and R automatically
> define's NA to the blanks ???
> 
> Best thanks for advance
> and regards, christian
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________________________________
> 1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
> IhrName at web.de, 8MB Speicher, Verschluesselung - http://freemail.web.de
> 
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help 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-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list