# NOT RUN {
if (requireNamespace("jsonvalidate", quietly = TRUE) &
requireNamespace("jsonlite", quietly = TRUE)) {
dat <- data.frame(
x = c(NA, 1, NA),
y = c(NA, NA, "foo")
)
schema <- '{
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"x": {
"type": "integer"
},
"y": {
"type": "integer"
}
},
"required": ["x", "y"]
}
'
check_schema_df(dat, schema)
}
# }
Run the code above in your browser using DataLab