View source: R/lib_data_loader.R
| apply_schema_validation | R Documentation |
Runs validate_schema() and acts on the result: fatal issues raise an
error via stop(), warning-severity issues emit a warning().
apply_schema_validation(df_raw, provenance)
df_raw |
The data frame to validate. |
provenance |
A provenance list as returned by |
Invisibly, TRUE if no issues were found and FALSE
otherwise. Errors if any fatal issue is present.
prov <- list(schema = list(expected_columns = "id"))
apply_schema_validation(data.frame(id = 1), prov)
# A missing required column is fatal:
try(apply_schema_validation(data.frame(x = 1), prov))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.