The function checks the which columns are factors and converts these to character vectors

df_factors_to_char(rp)

Arguments

rp

A dataframe

Details

all credits to Thierry Onkelinx

See also

Other Data_handling_utilities: convertdf_enc(), csv_to_sqlite()

Examples

df_factors_to_char(PlantGrowth) # column group will be chars as well
#> Warning: `mutate_each_()` was deprecated in dplyr 0.7.0.
#>  Please use `across()` instead.
#>  The deprecated feature was likely used in the inborutils package.
#>   Please report the issue at <https://github.com/inbo/inborutils/issues>.
#> Warning: `funs()` was deprecated in dplyr 0.8.0.
#>  Please use a list of either functions or lambdas:
#> 
#> # Simple named list: list(mean = mean, median = median)
#> 
#> # Auto named with `tibble::lst()`: tibble::lst(mean, median)
#> 
#> # Using lambdas list(~ mean(., trim = .2), ~ median(., na.rm = TRUE))
#>  The deprecated feature was likely used in the inborutils package.
#>   Please report the issue at <https://github.com/inbo/inborutils/issues>.
#>    weight group
#> 1    4.17  ctrl
#> 2    5.58  ctrl
#> 3    5.18  ctrl
#> 4    6.11  ctrl
#> 5    4.50  ctrl
#> 6    4.61  ctrl
#> 7    5.17  ctrl
#> 8    4.53  ctrl
#> 9    5.33  ctrl
#> 10   5.14  ctrl
#> 11   4.81  trt1
#> 12   4.17  trt1
#> 13   4.41  trt1
#> 14   3.59  trt1
#> 15   5.87  trt1
#> 16   3.83  trt1
#> 17   6.03  trt1
#> 18   4.89  trt1
#> 19   4.32  trt1
#> 20   4.69  trt1
#> 21   6.31  trt2
#> 22   5.12  trt2
#> 23   5.54  trt2
#> 24   5.50  trt2
#> 25   5.37  trt2
#> 26   5.29  trt2
#> 27   4.92  trt2
#> 28   6.15  trt2
#> 29   5.80  trt2
#> 30   5.26  trt2