View source: R/write_factors.R
write_factors | R Documentation |
write_factors
creates a template as a yaml file for
supplying code definition metadata for factors in a tabular data object that
resides in the R environment.
write_factors(dfname, overwrite = FALSE)
dfname |
(character) Unquoted name of the R data frame or tibble. |
overwrite |
(logical) Logical indicating if an existing factors file in the target directory should be overwritten. |
The yaml template generated by write_factors includes the field names of all fields defined as factors, and each level of the factor. The template supports the ability to provide a definition for each level. The yaml file is written with the name of the data object in R + "_factors". The create_dataTable function will search for this file when creating a EML dataTable entity.
The name of the file generated is returned, and a template for providing code definition metadata as a yaml file with the file name of the R data object + "_factors.yaml" is created in the working directory.
The user must follow yaml convention to ensure that input is formatted appropriately (e.g., quoting when needed; see https://www.yaml.info/learn/quote.html).
## Not run:
# overwrite existing factors file
capeml::write_factors(
dfname = data_object,
overwrite = TRUE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.