[R] Logical operator and lists

Gerrit Eichner Gerrit.Eichner at math.uni-giessen.de
Tue Jan 8 16:24:13 CET 2013


Hello, Dominic,

untested:

data <- lapply( data, function( x) x[ x == ""] <- NA

  Hth  --  Gerrit


On Tue, 8 Jan 2013, Dominic Roye wrote:

> Hello R-Helpers,
>
> I have a slight problem with the expresion data[data==""] <- NA which works
> well for a data.frame. But now i must use the same for a list of
> data.frames.
>
> My idea is data[[]][data==""] but it don´t work.
>
> Thanks!!
>
> Dominic


More information about the R-help mailing list