schema | R Documentation |
Create a schema object
schema(...)
... |
Formulae of the form tidyselect_expr ~ predicate |
A Schema object
# Simple schema with one declared column
my_schema <- schema(
mpg ~ is.double
)
# Multiple columns
my_schema <- schema(
Sepal.Length ~ is.numeric,
Species ~ is.factor
)
# Use tidyselect syntax and anonymous functions
my_schema <- schema(
starts_with("Sepal") ~ is.numeric,
c(Petal.Length, Petal.Width) ~ function(x) all(x > 0)
)
# Use named arguments to customize error messages
my_schema <- schema(
`Must be a positive number` = cyl ~ function(x) all(x > 0)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.