[R] is.infinite usage

Ernesto Jardim ernesto at ipimar.pt
Wed Apr 21 17:10:11 CEST 2004


On Wed, 2004-04-21 at 15:53, Uwe Ligges wrote:
> Ernesto Jardim wrote:
> 
> > Hi,
> > 
> > Is there a way of using is.infinite as is.na ? I'd like to avoid looping
> > the data.frame.
> > 
> > 
> >>mat
> > 
> >   x   y  z
> > 1 1 Inf NA
> > 2 2 Inf NA
> > 3 3 Inf NA
> > 
> >>is.na(mat)
> > 
> >       x     y    z
> > 1 FALSE FALSE TRUE
> > 2 FALSE FALSE TRUE
> > 3 FALSE FALSE TRUE
> > 
> > What I get at the moment is
> > 
> > 
> >>is.infinite(mat)
> > 
> >     x     y     z
> > FALSE FALSE FALSE
> 
> 
> No, but what's the problem using
> 
>    sapply(mat, is.infinite)
> 
> instead?
> 
> Uwe Ligges
> 
> 
> 
> > Thanks
> > 
> > EJ
> > 
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

None,

It works !

Thanks

EJ




More information about the R-help mailing list