ttt <- data.frame(A = c(Inf, 0, 0), B = c(1, 2, 3))
> apply(ttt, 2, function(x) {x[is.infinite(x)] <- 0; x})
>
>
Ok thank you. That does work. What does
apply(ttt, 1, function(x) x[is.infinite(x)] <- 0 )
this return. I get all 0's,but can you explai why ?
Thank you.
Ashim
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.