Skip to contents

Coerce numeric columns to character

Usage

df_2_chr(df)

Arguments

df

<data.frame> or <tibble>

Value

A <data.frame> or <tibble> with numeric columns coerced to character

Examples

dplyr::tibble(
   int = 1:10,
   chr = letters[1:10],
   date = rep(Sys.Date()), nrow(int)) |>
df_2_chr()
#> # A tibble: 10 × 3
#>    int   chr   date      
#>    <chr> <chr> <chr>     
#>  1 1     a     2024-09-23
#>  2 2     b     2024-09-23
#>  3 3     c     2024-09-23
#>  4 4     d     2024-09-23
#>  5 5     e     2024-09-23
#>  6 6     f     2024-09-23
#>  7 7     g     2024-09-23
#>  8 8     h     2024-09-23
#>  9 9     i     2024-09-23
#> 10 10    j     2024-09-23