[R-lang] Re: How to handle missing data when I try to log-transform my data

Scott Jackson scottuba@gmail.com
Wed Jun 23 12:10:43 PDT 2010


yes indeed, thanks for the correction, sorry for any confusion...

In fact, they both work!

What does not work is:

data[data$rt == NA, ]

in trying to refer to rows where rt is NA.  For that, you do need is.na:

data[is.na(data$rt), ]

sorry again for creating any confusion.

best,
-scott

On Wed, Jun 23, 2010 at 3:02 PM, Daniel Ezra Johnson
<danielezrajohnson@gmail.com> wrote:
> scott wrote:
> The following does NOT work:
> data$RT[data$RT < 100] <- NA
> The following DOES work:
> is.na(data$RT[data$RT < 100]) <- TRUE
>
> steve wrote:
> By the way, there is an easy syntax for this in R (that I didn't know
> about for a while):
> d$rt[d$rt < 100] <- NA
>
> my own experience backs steve in this controversy.
> the simpler command does seem to work.
>
> dan
>


More information about the ling-r-lang-L mailing list