is.wholenumber: Tests if a numeric vector is completely consisting of...

Description Usage Arguments Value

View source: R/utilities.r

Description

This function can be used to distinguish e.g. dummy variables (only 0 and 1) from other numeric columns. Applying to non numeric columns will fail. It also allows for negative whole numbers and decimals with no rest e.g. 3.0, as this can be a matter of print formatting rather of type

Usage

1
is.wholenumber(x, tolerance = .Machine$double.eps^0.5)

Arguments

x

the vector to be tested, use 'sapply(x, is.wholenumber)' for a data frame

tolerance

numerical specifying the tolerance for rounding a value. defaults to '.Machine$double.eps^0.5' with '.Machine$double.eps' being the smallest positive floating-point number x such that 1 + x != 1

Value

A logical vector returning TRUE for column(s) that are completely integers


RJ333/phyloseq2ML documentation built on June 2, 2020, 9:25 p.m.