Cast variables of one type to another
Arguments
- df
data.frame
- type_from
original type (a class from
base::inherits())- type_to
new type (from calling
as.*)- vars
(character) vector of variable names to change if they are of type
type_from(ifNULL, use all)
Examples
if (FALSE) {
df |>
cast("numeric", "factor") |>
get_desc_table(c("Age", "Nationality"), tbl_fn=tbl_fn_fac)
}