Hello,
I wish to create a copy of a data frame, but with missing values replaced
with NAs.

I thought I should be able to do it in one step using parentheses to group
the statements and force those inside the parens to execute first:

df <- (BWS6[BWS6 < -998] <- NA)

But all this does is assign NA to df, as described in ?"[" for the case
with no parens.

Can I do this in some way? It's no great problem of course to have two
separate statements, just curious.

Ben.

        [[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