search_dataset: (ENG) Search for a dataset in the Mexico City's Open Data...

Description Usage Arguments Value Examples

Description

api_request wrapper. Search for a dataset in the Mexico City's Open Data catalog that matches the specified query. This function can print and/or return the search results (see verbose and return).

Usage

1
2
search_dataset(query, exclude_args = NULL, nresults = 9999L,
  verbose = TRUE, return = TRUE)

Arguments

query

A character vector of length 1 containing the query to match in the search.

exclude_args

A named character vector containing dataset metas that must be excluded from the search results.

nresults

An integer specifying the number of results to show.

verbose

Logical. Print search results?

return

Logical. Return search results as a data frame?

Value

If return == True, this function returns a data frame containing the search results. Each row will contain the id, title, description, publisher, and size of the dataset that matched the search query. If verbose == True, this function will also print the search results into the console.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Search for all datasets matching the query 'metro'
## Not run: 
search_results <- search_dataset(query = "metro", verbose = TRUE, return = TRUE)

## End(Not run)

## Search for all datasets matching the query 'metro', but exclude datasets with id = 'estaciones-metro'
## Not run: 
exclude <- "estaciones-metro"
names(exclude) <- "datasetid"
search_results <- search_dataset(query = "metro", verbose = TRUE, return = TRUE, exclude_args = exclude)

## End(Not run)

## Search for all datasets matching the query 'metro', but don't print the results
## Not run: 
search_results <- search_dataset(query = "metro", verbose = FALSE, return = TRUE)

## End(Not run)

pablorm296/CDMX documentation built on June 4, 2019, 11:51 a.m.