I\'d like to check if a data.frame has any non-finite elements.
This seems to evaluate each column, returning FALSE for each (I\'m guessing its evaluating the data.f
If you type methods(is.na) you'll see that it has a data.frame method, which probably explains why it works the way you expect, where is.finite does not. The usual solution would be to write one yourself, since it's only one line. Something like this maybe,
is.finite.data.frame <- function(obj){
sapply(obj,FUN = function(x) all(is.finite(x)))
}