Skip to contents

Wraps the CKAN package_search action so users can discover datasets that are not in the built-in MORIE catalog and fetch them through morie_fetch_ckan or morie_fetch.

Usage

morie_ckan_search(query, portal = "open.canada.ca", rows = 25L, ...)

Arguments

query

Free-text search string.

portal

A known portal name ("open.canada.ca", "data.ontario.ca", "open.toronto.ca") or a full CKAN base URL (e.g. "https://catalogue.example.org").

rows

Maximum number of datasets to return (default 25).

...

Extra named CKAN package_search parameters (e.g. fq = "res_format:CSV", sort = "metadata_modified desc").

Value

A data.frame with one row per resource, columns: dataset_title, dataset_id, resource_id, resource_name, format, datastore_active, url. Feed resource_id into morie_fetch_ckan(resource_id = ...).

Examples

if (FALSE) { # \dontrun{
hits <- morie_ckan_search("cannabis survey", portal = "open.canada.ca")
head(hits[, c("dataset_title", "resource_id", "format")])
} # }