govcan_search {rgovcan} | R Documentation |
Query OpenCan portal for datasets (CKAN packages) matching keywords
Description
This function wraps ckanr::package_search()
to search for any
records matching a given set of keywords within the Open Canada Portal.
Usage
govcan_search(
keywords,
records = 10,
only_results = TRUE,
format_results = FALSE,
...
)
Arguments
keywords |
(character vector) A set of keywords to query. |
records |
(numeric) The number of matching records to return from the CKAN query (number of rows in the JSON output), default to 10. |
only_results |
(logical) Whether the function should return only the
results without the query metadata (default is |
format_results |
(logical) Whether the function should return a
formatted output of the results as a |
... |
More arguments to be passed on to |
Value
If only_results
is TRUE
and format_results
is FALSE
(recommended), will return only the results of the search as a
CKAN_package_stack
. If only_results
is FALSE
, will return a list
including also the query metadata. If format_results
is TRUE
, the
function formats the output as a data frame (not CKAN packages).
Examples
## Not run:
search <- govcan_search("dfo", 10)
search_format <- govcan_search("dfo", 10, format_results = TRUE)
search_list <- govcan_search("dfo", 10, only_results = FALSE)
search_list_format <- govcan_search("dfo", 10, format_results = TRUE,
only_results = FALSE)
## End(Not run)