Message-ID: <c9ce82b00904261931r5da9f1cel51205d084cadae99@mail.gmail.com>
Date: 2009-04-27T02:31:37Z
From: Sundar Dorai-Raj
Subject: Cannot clean infinite values
In-Reply-To: <23248409.post@talk.nabble.com>
Use ?is.infinite
inf <- is.infinite(data)
data[inf] <- 0.3 * sign(data[inf])
On Sun, Apr 26, 2009 at 5:44 PM, Nigel Birney <nan23 at cam.ac.uk> wrote:
>
> Hello all,
>
> I have to import numeric data from file but found it contains Infinite
> values which need to be eliminated. I tried to replace them in this way:
>
> ? ? ? ?data[which(data=="-Inf")] <- -0.3
> ? ? ? ?data[which(data=="+Inf")] <- ?0.3
>
> But, somehow, the Infinite values stayed there. Any suggestions?
>
> regards,
>
> N.
> --
> View this message in context: http://www.nabble.com/Cannot-clean-infinite-values-tp23248409p23248409.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>