Test an object x. See Details for an explanation of how each function operates.

is_char_numeric(x)

is_formula(x)

Arguments

x

an object to check.

Value

logical

Details

is_char_numeric

TRUE if x can be converted into a numeric vector by as.numeric without coercing character elements without a commonly-understood numeric representation.

is_formula

TRUE if x is a formula object.

Examples

is_char_numeric(c(1, 3, "3", NA))
#> [1] TRUE TRUE TRUE NA
is_char_numeric(c(1, 3, "3", NA, "A"))
#> [1] TRUE TRUE TRUE NA FALSE
is_formula("y ~ x")
#> [1] FALSE
is_formula(as.formula("y ~ x"))
#> [1] TRUE