Classify the variables between 5 types: "numeric", "categorical", "binary", "date", or NA.
Source:R/formats.R
variableTypes.Rd
Classify the variables between 5 types: "numeric", "categorical", "binary", "date", or NA.
Examples
# \donttest{
library(PatientProfiles)
x <- dplyr::tibble(
person_id = c(1, 2),
start_date = as.Date(c("2020-05-02", "2021-11-19")),
asthma = c(0, 1)
)
variableTypes(x)
#> # A tibble: 3 × 2
#> variable_name variable_type
#> <chr> <chr>
#> 1 person_id numeric
#> 2 start_date date
#> 3 asthma numeric
# }