View source: R/validate_types.R
| validate_types | R Documentation |
Checks each selected predictor's actual data against the user-declared type. Returns a list of errors (blocking), warnings (non-blocking), and any Date/POSIXct columns that will be auto-converted to numeric.
validate_types(df, type_map, predictors)
df |
A data frame. |
type_map |
Named list or character vector. Names are column names,
values are declared types (e.g., |
predictors |
Character vector of selected predictor column names. |
A list with components:
Logical. TRUE if no blocking errors found.
Character vector of non-blocking warnings.
Character vector of blocking errors.
Character vector of Date/POSIXct predictor columns that will be auto-converted to numeric.
df <- data.frame(price = c(100, 200, 300), city = c("A", "B", "C"))
types <- list(price = "numeric", city = "character")
validate_types(df, types, predictors = c("price", "city"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.