2
votes

I've got a weird problem with R. I'm trying this:

is.wholenumber(5)

and I get

Error: could not find function "is.wholenumber"

I don't understand what the problem is. It's a basic function which is even referred to in: help(is.integer) so it should be there without needing additional downloading or special way of using?!?

2

2 Answers

6
votes
library("FRACTION")
is.wholenumber(5)
[1] TRUE
6
votes

is.wholenumber() is not a base function, but rather one defined in the example as so:

is.wholenumber <- function(x, tol = .Machine$double.eps^0.5) {
    abs(x - round(x)) < tol
}

You can type that in and then it will be a function.