could_this_be_that | R Documentation |
Tests if vector could be a another data type without errors.
could_chr_be_num(.x)
could_chr_be_int(.x)
could_num_be_int(.x)
could_chr_be_dtm(.x)
could_chr_be_dte(.x)
.x |
vector of the data type that should be tested. |
The name logic of could_chr_be_num
should be interpreted as:
Could this character vector be a numeric vector?
The same logic goes for all functions named could_this_be_that.
TRUE or FALSE
vignette("s")
, vignette("hablar")
x <- c("1", "3", "7")
could_chr_be_num(x)
could_chr_be_int(x)
x <- c("abc", "3", "Hello world")
could_chr_be_num(x)
x <- c(NA, "3.45", "5,98")
could_chr_be_num(x)
could_chr_be_int(x)
x <- as.numeric(c(3.45, 1.5))
could_num_be_int(x)
x <- as.numeric(c(7, 2))
could_num_be_int(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.