## create a valid safeframe
x <- cars |>
make_safeframe(
mph = "speed",
distance = "dist"
)
x
## validation
validate_safeframe(x,
mph = c("numeric", "factor"),
distance = "numeric"
)
## the below issues an error
## note: tryCatch is only used to avoid a genuine error in the example
tryCatch(validate_safeframe(x,
mph = c("numeric", "factor"),
distance = "factor"
), error = paste)
Run the code above in your browser using DataLab