| Title: | Datasets of the CEO (Centre d'Estudis d'Opinio) for Opinion Polls in Catalonia |
|---|---|
| Description: | Easy and convenient access to the datasets of the "Centre d'Estudis d'Opinio", the Catalan institution for polling and public opinion. The package retrieves microdata directly from the open data platform of the Generalitat de Catalunya and returns it in a tidy format. |
| Authors: | Xavier Fernández-i-Marín [aut] (ORCID: <https://orcid.org/0000-0002-9522-8870>), Joel Ardiaca [aut, cre] (ORCID: <https://orcid.org/0009-0004-4937-8941>) |
| Maintainer: | Joel Ardiaca <[email protected]> |
| License: | GPL-3 |
| Version: | 1.4.0 |
| Built: | 2026-05-29 09:29:35 UTC |
| Source: | https://github.com/ceopinio/ceodata |
Returns the catalogue of "microdades acumulades" series published in
Dades Obertes (Socrata). Each row corresponds to a series, identified by
codi_serie (e.g. "BOP_presencial").
CEOaccumulated_meta(series = NULL, active_only = FALSE)CEOaccumulated_meta(series = NULL, active_only = FALSE)
series |
Optional character vector. If provided, filters results to those |
active_only |
Logical. If TRUE, keeps only series marked as active (best-effort; depends on |
A tibble with the metadata of the accumulated microdata series.
## Not run: m <- CEOaccumulated_meta() unique(m$codi_serie) CEOaccumulated_meta(series = "BOP_presencial") ## End(Not run)## Not run: m <- CEOaccumulated_meta() unique(m$codi_serie) CEOaccumulated_meta(series = "BOP_presencial") ## End(Not run)
Easy and convenient access to datasets / microdata from the
"Centre d'Estudis d'Opinio". The function can return either:
(1) an accumulated microdata series (identified by series), or
(2) a single study microdata dataset (identified by reo).
CEOdata(series = "BOP_presencial", reo = NA, raw = FALSE)CEOdata(series = "BOP_presencial", reo = NA, raw = FALSE)
series |
Character scalar identifying the accumulated series to download.
Ignored when |
reo |
Single REO identifier of a study to download. Can be character, numeric, or factor-like, and is normalized internally. |
raw |
Logical. If FALSE (default), converts SPSS labelled vectors into factors. If TRUE, returns raw haven-labelled vectors. |
Accumulated series are obtained from the Dades Obertes catalogue and are
usually identified by codi_serie (e.g. "BOP_presencial").
A tibble with individuals' responses to the requested dataset.
## Not run: # Default: accumulated microdata series d <- CEOdata() # Load another accumulated series by code d_tel <- CEOdata(series = "BOP_telefonica") # Load a single study by REO d1145 <- CEOdata(reo = "1145") ## End(Not run)## Not run: # Default: accumulated microdata series d <- CEOdata() # Load another accumulated series by code d_tel <- CEOdata(series = "BOP_telefonica") # Load a single study by REO d1145 <- CEOdata(reo = "1145") ## End(Not run)
Easy and convenient access to the metadata of the "Centre d'Estudis d'Opinio", the Catalan institution for polling and public opinion.
CEOmeta( reo = NULL, search = NULL, date_start = NA, date_end = NA, browse = FALSE, browse_translate = NULL, browse_force = FALSE )CEOmeta( reo = NULL, search = NULL, date_start = NA, date_end = NA, browse = FALSE, browse_translate = NULL, browse_force = FALSE )
reo |
Character vector with one or more REO identifiers. When not NULL it
has precedence over |
search |
Character vector with keywords to look for in metadata text fields. Each element is interpreted as one search expression; multiple elements are combined with OR. Matching is case-insensitive. |
date_start |
Optional start date ( |
date_end |
Optional end date ( |
browse |
Logical value. If TRUE, open matching metadata URLs in the
browser (up to 10 entries unless |
browse_translate |
Optional language code when |
browse_force |
Logical value. If TRUE, bypasses the safety limit of opening at most 10 URLs. |
A tibble with the metadata of surveys produced by the CEO.
## Not run: # Retrieve metadata of all surveys: meta <- CEOmeta() dim(meta) # Search for specific terms: CEOmeta(search = "internet") # "Medi" AND "Ambient" CEOmeta(search = "Medi ambient") # ("Medi" AND "Ambient") OR "Municipi" CEOmeta(search = c("Medi ambient", "Municipi")) # Search for entries starting in 2020 CEOmeta(date_start = "2020-01-01") # Get a specific REO and open its description in browser CEOmeta(reo = "746", browse = TRUE) ## End(Not run)## Not run: # Retrieve metadata of all surveys: meta <- CEOmeta() dim(meta) # Search for specific terms: CEOmeta(search = "internet") # "Medi" AND "Ambient" CEOmeta(search = "Medi ambient") # ("Medi" AND "Ambient") OR "Municipi" CEOmeta(search = c("Medi ambient", "Municipi")) # Search for entries starting in 2020 CEOmeta(date_start = "2020-01-01") # Get a specific REO and open its description in browser CEOmeta(reo = "746", browse = TRUE) ## End(Not run)
Easy and convenient access to the metadata of the "Centre d'Estudis d'Opinio", the Catalan institution for polling and public opinion. It allows to search for specific terms to obtain the details of the datasets available
CEOsearch(d, keyword = NULL, where = "variables", translate = FALSE)CEOsearch(d, keyword = NULL, where = "variables", translate = FALSE)
d |
Microdata retrieved from the CEO using the CEOdata() function. It is a data frame with variable labels. |
keyword |
The character string defining the word / concept to look for within the microdata. |
where |
A character vector specifying if the function should look amongst variable labels ("variables", default), or amongst value labels ("values"). |
translate |
Logical. When TRUE, it opens a browser with an automatic translation to English of the variable names and labels using Google Translate. Given the specificity of the terms, only the English translation is provided. Defaults to FALSE. |
A tibble with the set of variables that match the keyword ("Variable"). If the variables are requested, the second variable is their labels ("Label"), and if the values are required the second on is the value labels ("Value").
## Not run: # Retrieve a dataset to use the function d <- CEOdata() # Get the whole set of variable labels CEOsearch(d) # Get the whole set of value labels CEOsearch(d, where = "values") # Search for specific variable names and variable labels with the string "edat" (age). CEOsearch(d, keyword = "edat") # Search for specific variable names and variable labels with the string "edat" (age), # and translate the results to English. CEOsearch(d, keyword = "edat", translate = TRUE) # now for the combination of "valoracio" OR "covid" OR "govern". CEOsearch(d, keyword = c("valoració", "covid", "govern")) ## End(Not run)## Not run: # Retrieve a dataset to use the function d <- CEOdata() # Get the whole set of variable labels CEOsearch(d) # Get the whole set of value labels CEOsearch(d, where = "values") # Search for specific variable names and variable labels with the string "edat" (age). CEOsearch(d, keyword = "edat") # Search for specific variable names and variable labels with the string "edat" (age), # and translate the results to English. CEOsearch(d, keyword = "edat", translate = TRUE) # now for the combination of "valoracio" OR "covid" OR "govern". CEOsearch(d, keyword = c("valoració", "covid", "govern")) ## End(Not run)