openes_keywords: Explore datasets by keywords and publishers in <URL:...

Description Usage Arguments Details Value See Also Examples

View source: R/openes_keywords.R

Description

Explore datasets by keywords and publishers in https://datos.gob.es/

Usage

1
openes_keywords(keyword, publisher)

Arguments

keyword

A character string specifying a keyword to identify a data set. For example, 'vivienda'.

publisher

A character string with the publisher code. Should be only one publisher code. See publishers_available for the permitted publisher codes.

Details

openes_keywords works only for searching for one keyword for a given publisher. For example, 'viviendas' for the Ayuntamiento of Barcelona. If there are no matches for a keyword-publisher combination, openes_keywords will raise an error stating that there are no matches.

openes_keywords returns a data frame with the following columns:

In most cases the user will need to narrow down their search because the result of openes_keywords will have too many datasets. Beware that for passing the result of this function to openes_load the final data frame needs to be narrowed down to only one dataset (that is, 1 row) and the structure needs to be the same as from the original output of openes_keywords (same column names, in the same order). See examples below.

Value

A tibble containing the matched datasets.

See Also

openes_load

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 

library(dplyr)

kw <- openes_keywords("vivienda", "l01080193") # Ayuntamiento de Barcelona

kw

# Notice how we narrow down to only 1 dataset
dts <-
 kw 
 filter(grepl("Precios", description)) 
 openes_load('ASCII')

# Notice that we had to specify the encoding because printing the dataset returns an error.
# If that happens to you, try figuring out the encoding with readr::guess_encoding(dts$data[[1]])
# and specify the most likely encoding in `openes_load`

dts$metadata

dts$data

## End(Not run)

cimentadaj/datos_gob documentation built on April 16, 2021, 11:47 a.m.