data_add | R Documentation |
Add information about variables in a dataset to a datapackage.json
metadata file.
data_add(filename, meta = list(), packagename = "datapackage.json",
dir = ".", write = TRUE, refresh = TRUE, sha = "512",
clean = FALSE, open_after = FALSE)
filename |
A character vector of paths to plain-text tabular data files, relative to |
meta |
Information about each data file. A list with a list entry for each entry in
|
packagename |
Package to add the metadata to; path to the |
dir |
Directory in which to look for |
write |
Logical; if |
refresh |
Logical; if |
sha |
A number specifying the Secure Hash Algorithm function,
if |
clean |
Logical; if |
open_after |
Logical; if |
meta
should be a list with unnamed entries for entry in filename
,
and each entry can include a named entry for any of these:
A list or list of lists with entries for at least name
, and ideally for url
.
A list or list of lists with entries for at least variable
(the name of a variable in the dataset).
Might also include map
with a list or path to a JSON file resulting in a list with an
entry for each ID, and additional information about that entity, to be read in a its features.
All files will be loaded to help with aggregation, but local files will be included in the datapackage,
whereas hosted files will be loaded client-side.
A string giving the name of a variable in the dataset representing a repeated observation of the same entity.
A list with named entries providing more information about the variables in the dataset.
See data_measure_info
.
An invisible version of the updated datapackage, which is also written to
datapackage.json
if write = TRUE
.
Initialize the datapackage.json
file with init_data
.
## Not run:
# write example data
write.csv(mtcars, "mtcars.csv")
# add it to an existing datapackage.json file in the current working directory
data_add("mtcars.csv")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.