Create an organization
organization_create(name = NULL, id = NULL, title = NULL,
description = NULL, image_url = NULL, state = "active",
approval_status = NULL, extras = NULL, packages = NULL,
users = NULL, url = get_default_url(), key = get_default_key(),
as = "list", ...)
(character) the name of the organization, a string between 2 and 100 characters long, containing only lowercase alphanumeric characters, - and _
the id of the organization (optional)
(character) the title of the organization (optional)
(character) the description of the organization (optional)
(character) the URL to an image to be displayed on the organization's page (optional)
(character) the current state of the organization, e.g. 'active' or 'deleted', only active organization show up in search results and other lists of organization, this parameter will be ignored if you are not authorized to change the state of the organization (optional). Default: 'active'
(character) Approval status
The organization's extras (optional), extras are arbitrary (key: value) metadata items that can be added to organizations, each extra dictionary should have keys 'key' (a string), 'value' (a string) package_relationship_create() for the format of relationship dictionaries (optional)
(list of dictionaries) the datasets (packages) that belong to the organization, a list of dictionaries each with keys 'name' (string, the id or name of the dataset) and optionally 'title' (string, the title of the dataset)
(character) the users that belong to the organization, a list of dictionaries each with key 'name' (string, the id or name of the user) and optionally 'capacity' (string, the capacity in which the user is a member of the organization)
Base url to use. Default: http://data.techno-science.ca. See
also ckanr_setup
and get_default_url
.
A privileged CKAN API key, Default: your key set with ckanr_setup
(character) One of list (default), table, or json. Parsing with table option
uses jsonlite::fromJSON(..., simplifyDataFrame = TRUE)
, which attempts to parse
data to data.frame's when possible, so the result can vary from a vector, list or
data.frame. (required)
Curl args passed on to POST
(optional)
# NOT RUN {
# Setup
ckanr_setup(url = "https://demo.ckan.org/", key = getOption("ckan_demo_key"))
# create an organization
(res <- organization_create("foobar", title = "Foo bars", description = "love foo bars"))
res$name
# }
Run the code above in your browser using DataLab