I am trying to find the range
of a data frame with infinite values:
> f <- data.frame(x=c(1,2),y=c(3,Inf))
> range(f)
[1] 1 Inf
> range(f,finite=TRUE)
Error in FUN(X[[2L]], ...) :
only defined on a data frame with all numeric variables
Calls: Summary.data.frame -> lapply -> FUN
> range(f$y)
[1] 3 Inf
> range(f$y,finite=TRUE)
[1] 3 3
Why am I getting the error?
Can I do better than
> do.call(range,lapply(f,range,finite=TRUE))
[1] 1 3
Is this a bug? Is it known? Should I report it?