
Last chance! 50% off unlimited learning
Sale ends in
datapackage_init(df, package_name = NULL, output_dir = getwd(), meta = NULL, source_cleaner = NULL, source_cleaner_rename = TRUE, ...)
name
field is specified in meta
.name
, license
, and version
fields.
If resources
is not specified then this will be automatically
generated. dpmr
uses jsonlite
to convert the list into a
JSON file. See the toJSON
documentation for details.
If meta = NULL
then a barebones datapackage.json
file will be
created.df
data frame. Can be in R or any other language, e.g.
Python. Following Data Package convention the scripts are renamed
process*.*
, unless specified otherwise with
source_cleaner_rename
. source_cleaner
is not required, but
HIGHLY RECOMMENDED.source_cleaner
files.export
.## 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)
Run the code above in your browser using DataLab