Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find is.wholenumber() function

Tags:

r

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?!?

like image 645
carter7gindenv Avatar asked Apr 20 '26 10:04

carter7gindenv


2 Answers

library("FRACTION")
is.wholenumber(5)
[1] TRUE
like image 174
KFB Avatar answered Apr 22 '26 23:04

KFB


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.

like image 42
John Paul Avatar answered Apr 23 '26 01:04

John Paul



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!