package_create {ckanr} | R Documentation |
Create a package
Description
Create a package
Usage
package_create(
name = NULL,
title = NULL,
private = FALSE,
author = NULL,
author_email = NULL,
maintainer = NULL,
maintainer_email = NULL,
license_id = NULL,
notes = NULL,
package_url = NULL,
version = NULL,
state = "active",
type = NULL,
resources = NULL,
tags = NULL,
extras = NULL,
relationships_as_object = NULL,
relationships_as_subject = NULL,
groups = NULL,
owner_org = NULL,
url = get_default_url(),
key = get_default_key(),
as = "list",
...
)
Arguments
name |
(character) the name of the new dataset, must be between 2 and 100 characters long and contain only lowercase alphanumeric characters, - and _, e.g. 'warandpeace' |
title |
(character) the title of the dataset (optional, default: same as name) |
private |
(logical) whether the dataset should be private (optional,
default: |
author |
(character) the name of the dataset's author (optional) |
author_email |
(character) the email address of the dataset's author (optional) |
maintainer |
(character) the name of the dataset's maintainer (optional) |
maintainer_email |
(character) the email address of the dataset's maintainer (optional) |
license_id |
(license id string) - the id of the dataset's license, see license_list() for available values (optional) |
notes |
(character) a description of the dataset (optional) |
package_url |
(character) a URL for the dataset's source (optional) |
version |
(string, no longer than 100 characters) - (optional) |
state |
(character) the current state of the dataset, e.g. 'active' or 'deleted', only active datasets show up in search results and other lists of datasets, this parameter will be ignored if you are not authorized to change the state of the dataset (optional, default: 'active') |
type |
(character) the type of the dataset (optional), IDatasetForm plugins associate themselves with different dataset types and provide custom dataset handling behaviour for these types |
resources |
(list of resource dictionaries) - the dataset's resources,
see |
tags |
(list of tag dictionaries) - the dataset's tags, see
|
extras |
(list of dataset extra dictionaries) - the dataset's extras (optional), extras are arbitrary (key: value) metadata items that can be added to datasets, each extra dictionary should have keys 'key' (a string), 'value' (a string) |
relationships_as_object |
(list of relationship dictionaries) - see
|
relationships_as_subject |
(list of relationship dictionaries) - see
|
groups |
(data.frame) the groups to which the dataset
belongs, each row should have one or more of the
following columns which identify an existing group: 'id' (the id of the group,
string), or 'name' (the name of the group, string), to see which groups
exist call |
owner_org |
(character) the id of the dataset's owning organization,
see |
url |
Base url to use. Default: https://data.ontario.ca/ See
also |
key |
A privileged CKAN API key, Default: your key set with
|
as |
(character) One of list (default), table, or json. Parsing with
table option uses |
... |
Curl args passed on to |
Examples
## Not run:
# Setup
ckanr_setup(url = "https://demo.ckan.org/", key = getOption("ckan_demo_key"))
# create a package
## Example 1
(res <- package_create("foobar4", author="Jane Doe"))
res$author
## Example 2 - create package, add a resource
(res <- package_create("helloworld", author="Jane DOe"))
# include a group
# package_create("brownbear", groups = data.frame(id = "some-id"))
## End(Not run)