as_fr_field | R Documentation |
character
, factor
, numeric
, logical
, and Date
vectors into fr_field
objectsThe supported classes of R
objects are converted to the corresponding frictionless type
:
R class | fr type |
character() | string |
factor() | string (with enum(constraints = levels(x)) ) |
numeric() , integer() | number |
logical() | boolean |
Date | date |
as_fr_field(x, ...)
x |
a character, factor, numeric, integer, logical, or Date vector |
... |
< |
a fr_field object
as_fr_field(1:10, "example_integer") # -> frictionless number
as_fr_field((1:10) * 0.1, "example_double") # -> frictionless number
as_fr_field(letters, "example_character") # -> frictionless string
as_fr_field(factor(letters), "example_factor") # -> frictionless string with enum constraints
as_fr_field(c(TRUE, FALSE, TRUE), "example_logical") # -> frictionless boolean
as_fr_field(as.Date(c("2023-04-23", "2004-12-31")), "example_date") # -> frictionless date
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.