Hello everybody,

I know this is pretty basic stuff, but could anyone explain me how to
recode a single value of a variable
into a missing value?

I used to do it like this:

myData[myData$var1==5;"var1"]<-NA             # recode value "5" into "NA"

But the column "var1" already contains NAs, which
results in the following error message:

"missing values are not allowed in subscripted assignments of data frames"

Thank you very much for any advice!

David

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to