ds_create {ckanr} | R Documentation |
Add a new table to a datastore
Description
BEWARE: This function still doesn't quite work yet.
Usage
ds_create(
resource_id = NULL,
resource = NULL,
force = FALSE,
aliases = NULL,
fields = NULL,
records = NULL,
primary_key = NULL,
indexes = NULL,
url = get_default_url(),
key = get_default_key(),
as = "list",
...
)
Arguments
resource_id |
(string) Resource id that the data is going to be stored against. |
resource |
(dictionary) Resource dictionary that is passed to
|
force |
(logical) Set to |
aliases |
(character) Names for read only aliases of the resource. (optional) |
fields |
(list) Fields/columns and their extra metadata. (optional) |
records |
(list) The data, eg: |
primary_key |
(character) Fields that represent a unique key (optional) |
indexes |
(character) Indexes on table (optional) |
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 |
References
http://bit.ly/ds_create
Examples
## Not run:
ckanr_setup(url = "https://demo.ckan.org/",
key = getOption("ckan_demo_key"))
# create a package
(res <- package_create("foobarrrrr", author="Jane Doe"))
# then create a resource
file <- system.file("examples", "actinidiaceae.csv", package = "ckanr")
(xx <- resource_create(package_id = res$id,
description = "my resource",
name = "bears",
upload = file,
rcurl = "http://google.com"
))
ds_create(resource_id = xx$id, records = iris, force = TRUE)
resource_show(xx$id)
## End(Not run)