read_from_spec | R Documentation |
This convenience function can be used to read a dataset and augment it with meta-information from a specification file. The specification file is a YAML file with certain format. Using the function allows a cleaner separation of script logic from data and meta-data, resulting in more generic and re-usable scripts (the data and meta-data can be centralized and segregated from the scripting logic).
read_from_spec(spec, read.fun = read.csv, file = NULL, ...)
spec |
Either the name of a YAML file that contains the data
specification, or an equivalent object (i.e. as returned by
|
read.fun |
A function that reads in data. It should accept a file name
as its first argument and return some sort of
|
file |
The name of the file containing the data. if |
... |
Additional arguments that get passed to |
A data.frame
, as returned by read.fun
,
that has been augmented with meta-information from the data specification
(i.e. labels, factor levels).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.