hi everyone,
i had the same problem, i simply wrote:
*ifelse(is.infinite(AALB),NA,AALB)*
this code replace infinite values by NA's, then you can use "na.omit",
"replace", or even a zero, which is my case.
goog luck Nigel
--
View this message in context:
http://r.789695.n4.nabble.com/
Nigel Birney 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
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 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:
>
, April 26, 2009 8:45 PM
To: r-help@r-project.org
Subject: [R] Cannot clean infinite values
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"
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 sugg
5 matches
Mail list logo