x <- make_safeframe(cars,
mph = "speed",
distance = "dist"
)
x
## the below would issue an error
## note: tryCatch is only used to avoid a genuine error in the example
tryCatch(validate_types(x), error = paste)
## to allow other types, e.g. gender to be integer, character or factor
validate_types(x, mph = "numeric", distance = c(
"integer",
"character", "numeric"
))
Run the code above in your browser using DataLab