is_whole_number | R Documentation |
Similar to 'is_positive_integer()' but without the constraint that the underlying data type is actually integer. Useful if the numbers are stored as 'numeric' but you want to check that they are whole.
is_whole_number(x)
x |
A vector |
'NA's are ignored.
TRUE if all elements are whole numbers (NA ignored)
is_whole_number(c(2.0, 4.0)) # TRUE
is_whole_number(c(-1.4)) # FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.