Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is.whole

Test for Whole Numbers


Description

is.whole returns whether elements of a numeric vector are whole numbers.

Usage

is.whole(x, tol = .Machine[["double.eps"]])

Arguments

x

numeric vector.

tol

tolerance allowed for double floating point numbers. This is always a positive number. The default is based on the numerical characteristics of the machine that R is running on. See .Machine.

Value

TRUE for every element of 'x' that is a whole number and FALSE otherwise. The structure is a logical vector with length = length('x') and names = names('x').

Examples

v <- c(1.0, 1L, 1.1)
is.whole(v)

str2str

Convert R Objects from One Structure to Another

v0.1.1
GPL (>= 2)
Authors
David Disabato [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.