This function checks if x
is a ((non)-negative) ((non-)positive)
(integer) numeric (vector).
Usage
is_number(
x,
int = FALSE,
neg = FALSE,
non_neg = FALSE,
pos = FALSE,
non_pos = FALSE
)
Arguments
- x
An R object.
- int
A boolean, if TRUE
checks if x
is an integer.
- neg
A boolean, if TRUE
checks if x
is negative.
- non_neg
A boolean, if TRUE
checks if x
is non-negative.
- pos
A boolean, if TRUE
checks if x
is positive.
- non_pos
A boolean, if TRUE
checks if x
is non-positive.
Examples
fHMM:::is_number(1, int = TRUE)
#> [1] TRUE
fHMM:::is_number(pi, int = TRUE)
#> [1] FALSE