Description Usage Arguments Value Examples
View source: R/govcan_search.R
This function wraps ckanr::package_search()
to search for any
records matching a given set of keywords within the Open Canada Portal.
1 2 3 4 5 6 7 | govcan_search(
keywords,
records = 10,
only_results = TRUE,
format_results = FALSE,
...
)
|
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 |
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).
1 2 3 4 5 6 7 8 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.