Update a package's metadata

Share:

Description

Update a package's metadata

Usage

1
2
package_patch(x, id, key = get_default_key(), url = get_default_url(),
  as = "list", ...)

Arguments

x

(list) A list with key-value pairs

id

(character) Resource ID to update (required)

key

A privileged CKAN API key, Default: your key set with ckanr_setup

url

Base url to use. Default: http://data.techno-science.ca. See also ckanr_setup and get_default_url.

as

(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)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# Setup
ckanr_setup(url = "http://demo.ckan.org", key = getOption("ckan_demo_key"))

# Create a package
(res <- package_create("hello-world7", author="Jane Doe"))

# Get a resource
res <- package_show(res$id)
res$title
res$author_email

# Make some changes
x <- list(title = "!hello there world! bye")
package_patch(x, id = res$id)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.