Test an object x. See Details for an explanation of how each function operates.
is_char_numeric(x) is_formula(x)
| x | an object to check. |
|---|
logical
is_char_numericTRUE if x can be converted into a numeric vector by as.numeric without coercing character elements without a commonly-understood numeric representation.
is_formulaTRUE if x is a formula object.
is_char_numeric(c(1, 3, "3", NA))#> [1] TRUE TRUE TRUE NAis_char_numeric(c(1, 3, "3", NA, "A"))#> [1] TRUE TRUE TRUE NA FALSEis_formula("y ~ x")#> [1] FALSEis_formula(as.formula("y ~ x"))#> [1] TRUE