Description Usage Arguments Value Examples
View source: R/is_integer_like.R
Take a vector and check to see if it looks like it contains only integers.
1 |
x |
a vector of values to check |
TRUE or FALSE indicating if all values look like integers - if the vector is not of type character or numeric it will always return FALSE
1 2 3 4 5 6 7 8 9 | library(dplyr)
data <-
tibble(
x = c(1, 2, 3),
y = c("4", "5", "6"),
z = c("a", "b", "c")
)
data %>%
mutate(across(where(is_integer_like), as.integer))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.