View source: R/utils-typechecks.R
is_count | R Documentation |
This function checks if a numeric value is a count, meaning it is integer-like and non-negative.
is_count(x, include_zero = TRUE)
x |
Numeric value to check. |
include_zero |
Logical, whether to include zero as a valid count. |
TRUE
if x
is a count, otherwise FALSE
.
is_proportion
, is_integerlike
,
validate_count
, validate_proportion
is_count(0) # TRUE
is_count(3) # TRUE
is_count(0, include_zero = FALSE) # FALSE
is_count(-1) # FALSE
is_count(1.5) # FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.