Description Usage Arguments Details Value See Also Examples
View source: R/openes_keywords.R
Explore datasets by keywords and publishers in https://datos.gob.es/
1 | openes_keywords(keyword, publisher)
|
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 |
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:
description: a short description of each of the matched datasets in Spanish (Spanish is set as default if available, if not, then the first non-spanish language is chosen).
publisher: the entity that publishes the dataset. See openes_load_publishers
for all available publishers.
is_readable: whether that dataset is currently readable by openes_load
.
See permitted_formats
for currently available formats.
path_id: the end path that identifies that dataset in the https://datos.gob.es/ API.
url: the complete url of the dataset in https://datos.gob.es/. Note that this URL is not the access URL to the dataset but to the dataset's homepage in https://datos.gob.es/.
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.
A tibble
containing the matched datasets.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.