Numeric >=0. Absolute differences
greater than tolerance are treated as real differences.
Details
The object x is first tested to see if it is numeric. If not
the function returns 'FALSE'. Then if all the elements of
x are whole numbers to within the tolerance given by
tolerance the function returns 'TRUE'. If not it returns
'FALSE'.
Value
Either 'TRUE' or 'FALSE' depending on the result of the
test.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(DistributionUtils)
Loading required package: RUnit
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DistributionUtils/is.wholenumber.Rd_%03d_medium.png", width=480, height=480)
> ### Name: is.wholenumber
> ### Title: Is Object Numeric and Whole Numbers
> ### Aliases: is.wholenumber
> ### Keywords: classes
>
> ### ** Examples
>
> is.wholenumber(-3:5) # TRUE
[1] TRUE
> is.wholenumber(c(0,0.1,1.3,5)) # FALSE
[1] FALSE
> is.wholenumber(-3:5 + .Machine$double.eps) # TRUE
[1] TRUE
> is.wholenumber(-3:5 + .Machine$double.eps^0.5) # FALSE
[1] FALSE
> is.wholenumber(c(2L,3L)) # TRUE
[1] TRUE
> is.wholenumber(c("2L","3L")) # FALSE
[1] FALSE
> is.wholenumber(0i ^ (-3:3)) # FALSE
[1] FALSE
> is.wholenumber(matrix(1:6, nrow = 3)) # TRUE
[1] TRUE
> is.wholenumber(list(-1:3,2:6)) # FALSE
[1] FALSE
> is.numeric(list(-1:3,2:6)) # FALSE
[1] FALSE
> is.wholenumber(unlist(list(-1:3,2:6))) # TRUE
[1] TRUE
>
>
>
>
>
> dev.off()
null device
1
>