Description Usage Arguments Examples
Initialise a data package from a data frame, metadata list, and source code file used to create the data set.
1 2 |
df |
The object name of the data frame you would like to convert into a data package. |
package_name |
character string name for the data package. Unnecessary
if the |
output_dir |
character string naming the output directory to save the data package into. By default the current working directory is used. |
meta |
The list object with the data frame's meta data. The list
item names must conform to the Open Knowledge Foundation's Data Package
Protocol (see http://dataprotocols.org/data-packages/). Must include
the |
source_cleaner |
a character string or vector of file paths relative to
the current working directory pointing to the source code file used to gather
and clean the |
source_cleaner_rename |
logical. Whether or not to rename the
|
... |
arguments to pass to |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
# Create fake data
A <- B <- C <- sample(1:20, size = 20, replace = TRUE)
ID <- sort(rep('a', 20))
Data <- data.frame(ID, A, B, C)
# Initialise data package with barebones, automatically generated metadata
datapackage_init(df = Data, package_name = 'my-data-package')
# Initialise with user specified metadata
meta_list <- list(name = 'my-data-package',
title = 'A fake data package',
last_updated = Sys.Date(),
version = '0.1',
license = data.frame(type = 'PDDL-1.0',
url = 'http://opendatacommons.org/licenses/pddl/'),
sources = data.frame(name = 'Fake',
web = 'No URL, its fake.'))
datapackage_init(df = Data, meta = meta_list)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.