Andrew,
x[] <- lapply(x, function(xx) {
xx[is.nan(xx)] <- NA_real_
xx
})
is different from
x <- lapply(x, function(xx) {
xx[is.nan(xx)] <- NA_real_
xx
})
indeed, the two are different -- but some ignorance of mine is exposed.
i wonder, can you explain why the two are different?
is it because of (or, "is the clue...") this in the "Value:" section of
: ?"[<-.data.frame"
----
For '[<-', '[[<-' and '$<-', a data frame.
----
?
cheers, Greg