is_integer | R Documentation |
is_integer
tests if x
contains only integer numbers.
is_integer(x, tol = .Machine$double.eps^0.5)
x |
Number(s) to test (required, accepts numeric vectors). |
tol |
Numeric tolerance value.
Default: |
Thus, is_integer
does what the base R function is.integer
is not designed to do:
is_integer()
returns TRUE or FALSE depending on whether its numeric argument x
is an integer value (i.e., a "whole" number).
is.integer()
returns TRUE or FALSE depending on whether its argument is of type "integer", and FALSE if its argument is a factor.
See the documentation of is.integer
for definition and details.
is.integer
function of the R base package.
Other verification functions:
is_complement()
,
is_extreme_prob_set()
,
is_freq()
,
is_matrix()
,
is_perc()
,
is_prob()
,
is_suff_prob_set()
,
is_valid_prob_pair()
,
is_valid_prob_set()
,
is_valid_prob_triple()
is_integer(2) # TRUE is_integer(2/1) # TRUE is_integer(2/3) # FALSE x <- seq(1, 2, by = 0.5) is_integer(x) # Note contrast to base R: is.integer(2/1) # FALSE! # Compare: is.integer(1 + 2) is_integer(1 + 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.