I am trying to convert multiple variables from dbl to intergers in one block of code but I get the below error. Can someone help me overcome this error. I have included code below.
library(tidyverse)
Red <- tibble(
a = c( 1,2),
b = c(3,4),
c = c(5,6))
Red %>%
mutate(across(where(is.double), as.integer))
#> # A tibble: 2 x 3
#> a b c
#> <int> <int> <int>
#> 1 1 3 5
#> 2 2 4 6
Red %>%
mutate(across(a:c, as.integer))
#> # A tibble: 2 x 3
#> a b c
#> <int> <int> <int>
#> 1 1 3 5
#> 2 2 4 6