CEOdata is a package that facilitates the incorporation of microdata
(individual responses) of public opinion polls in Catalonia into
R
, as performed by the “Centre d’Estudis d’Opinió” (CEO,
Opinion Studies Center). It has basically three main functions with a
separate purpose:
CEOdata()
: that provides the
data of the surveys directly into R
.CEOmeta()
: that allows the user to
inspect the details of the available surveys (metadata) and to
search for specific topics and get the survey details.CEOsearch()
: that allows the user to
search for variables, variable labels and value labels within a survey
data gathered using the CEOdata()
function.CEOdata()
: Get the survey dataThe most comprehensive kind of data on Catalan public opinion is the
“Barometer”, that can be retrieved by default by the main function
CEOdata()
.
This provides a cleaned and merged version of all the available Barometers, since 2017, providing easy access to the following number of responses and variables:
## [1] 39838 1092
## # A tibble: 39,838 × 1,092
## PONDERA ORDRECINE ORDRE_REV…¹ REO METOD…² BOP_NUM ANY MES DIA HORA_…³
## <dbl> <dbl> <dbl> <dbl> <fct> <fct> <dbl> <dbl> <dbl> <time>
## 1 1.86 1 NA 746 <NA> Març 1… 2014 3 27 NA
## 2 1.86 2 NA 746 <NA> Març 1… 2014 3 5 NA
## 3 1.86 3 NA 746 <NA> Març 1… 2014 3 11 NA
## 4 1.86 4 NA 746 <NA> Març 1… 2014 3 11 NA
## 5 1.86 5 NA 746 <NA> Març 1… 2014 3 27 NA
## 6 1.86 6 NA 746 <NA> Març 1… 2014 3 28 NA
## 7 1.86 7 NA 746 <NA> Març 1… 2014 3 3 NA
## 8 1.86 8 NA 746 <NA> Març 1… 2014 3 25 NA
## 9 1.86 9 NA 746 <NA> Març 1… 2014 3 7 NA
## 10 1.86 10 NA 746 <NA> Març 1… 2014 3 27 NA
## # … with 39,828 more rows, 1,082 more variables: HORA_FIN <time>,
## # DATA_INI <date>, DATA_FIN <date>, DURADA <dbl>, FASE <fct>,
## # ENQUESTADOR_CODI <dbl>, ENQUESTADOR_SEXE <fct>, ENQUESTADOR_EDAT <dbl>,
## # ENQUESTADOR_ESTUDIS <fct>, ENQUESTADOR_NACIONALITAT <fct>,
## # NUM_QUEST_CAMP <dbl>, PROVINCIA <fct>, HABITAT <fct>, MUNICIPI <fct>,
## # COMARCA <fct>, CLUSTER <dbl>, ID_RUTA <dbl>, SECCIO_TEORICA <dbl>,
## # CONF_SECC <fct>, SECCIO_REAL <dbl>, DOMICILI_PARTICULAR <fct>, …
## [1] "PONDERA" "ORDRECINE"
## [3] "ORDRE_REVISADA" "REO"
## [5] "METODOLOGIA" "BOP_NUM"
## [7] "ANY" "MES"
## [9] "DIA" "HORA_INI"
## [11] "HORA_FIN" "DATA_INI"
## [13] "DATA_FIN" "DURADA"
## [15] "FASE" "ENQUESTADOR_CODI"
## [17] "ENQUESTADOR_SEXE" "ENQUESTADOR_EDAT"
## [19] "ENQUESTADOR_ESTUDIS" "ENQUESTADOR_NACIONALITAT"
## [21] "NUM_QUEST_CAMP" "PROVINCIA"
## [23] "HABITAT" "MUNICIPI"
## [25] "COMARCA" "CLUSTER"
## [27] "ID_RUTA" "SECCIO_TEORICA"
## [29] "CONF_SECC" "SECCIO_REAL"
## [31] "DOMICILI_PARTICULAR" "LLENGUA_ENQUESTA"
## [33] "PADRO" "RESIDENCIA"
## [35] "LLENGUA_SISTEMA" "CIUTADANIA"
## [37] "GENERE" "GENERE_LITERALS"
## [39] "SEXE" "EDAT"
## [41] "EDAT_GR" "EDAT_CEO"
## [43] "LLOC_NAIX" "HORA_PRIMERA_PREGUNTA"
## [45] "GRAVACIO" "TIPUS_GRAV"
## [47] "PRE_PROBLEMES" "PROBLEMES_LITERALS"
## [49] "PROBLEMES_R_1" "PROBLEMES_R_2"
CEOdata()
allows you to select specific Barometers, by
providing their internal register in the reo
argument. The
reo is the internal name that the CEO uses, and stands for “Registre
d’Estudis d’Opinió” (register of opinion studies), and is the main
identifier of the survey, also present in the table of meta data.
Although many of them are numbers, some have a number, a slash and
another number, and therefore a character vector must be passed. Only a
single REO can be passed, as it is not guaranteed that different data
matrices share any column, and may refer to very different topics.
For instance, to get only the data of the study with register “746” (corresponding to March 2013):
## Converting the original data into R. This may take a while.
## # A tibble: 2,000 × 475
## NUM NUM_CINE BOP_NUM MES ANY DIA CODI_ENQ HOR_INI HOR_FIN DURADA
## <dbl> <dbl> <fct> <dbl> <dbl> <dbl> <fct> <time> <time> <dbl>
## 1 NA 1 Març. 14 4 14 NA G3 NA NA 1203
## 2 NA 2 Març. 14 4 14 NA T4 NA NA 997
## 3 NA 3 Març. 14 4 14 NA G3 NA NA 1127
## 4 NA 4 Març. 14 4 14 NA B5 NA NA 1792
## 5 NA 5 Març. 14 4 14 NA B6 NA NA 1418
## 6 NA 6 Març. 14 3 14 NA L1 NA NA 1964
## 7 NA 7 Març. 14 4 14 NA G4 NA NA 2283
## 8 NA 8 Març. 14 4 14 NA B3 NA NA 1322
## 9 NA 9 Març. 14 3 14 NA B2 NA NA 1778
## 10 NA 10 Març. 14 3 14 NA T4 NA NA 1119
## # … with 1,990 more rows, and 465 more variables: num_quest <dbl>,
## # sexe_enq <fct>, edat_enq <dbl>, estudis_enq <fct>, nacionalitat_enq <fct>,
## # PROVI <fct>, HABITAT <fct>, MUN <fct>, ADRECA <chr>, COMARCA <fct>,
## # SEXE <fct>, EDAT <dbl>, SE <chr>, GR_EDAT <fct>, Edat_CEO <fct>, F01 <fct>,
## # F02 <fct>, F03 <fct>, F04 <fct>, PRE_P1 <fct>, P1_LITERALS <chr>,
## # P1_100_R <dbl>, P1_200_R <dbl>, P1_300_R <dbl>, P1_400_R <dbl>,
## # P1_500_R <dbl>, P1_600_R <dbl>, P1_700_R <dbl>, P1_800_R <dbl>, …
Not all studies carried on by the CEO (and therefore listed in the
CEOmeta()
function –see below–) have microdata available.
For convenience, there is a variable in the metadata that returns
whether the microdata is available or not
(microdata_available
).
When using the kind
argument (which is the default), the
function CEOdata()
also allows to restrict the whole set of
barometers based on specific time frames defined by a date with the
arguments date_start
and date_end
using the
YYYY-MM-DD format. Notice that only the barometers are considered when
using this arguments, not other studies.
## Downloading the barometer.
## Converting the original data into R. This may take a while.
## Post-processing the data. This may take a while.
## # A tibble: 4,500 × 1,092
## PONDERA ORDRECINE ORDRE_REV…¹ REO METOD…² BOP_NUM ANY MES DIA HORA_…³
## <dbl> <dbl> <dbl> <dbl> <fct> <fct> <dbl> <dbl> <dbl> <time>
## 1 1 23339 NA 919 <NA> Març 1… 2019 3 4 NA
## 2 1 23340 NA 919 <NA> Març 1… 2019 3 4 NA
## 3 1 23341 NA 919 <NA> Març 1… 2019 3 4 NA
## 4 1 23342 NA 919 <NA> Març 1… 2019 3 4 NA
## 5 1 23343 NA 919 <NA> Març 1… 2019 3 4 NA
## 6 1 23344 NA 919 <NA> Març 1… 2019 3 4 NA
## 7 1 23345 NA 919 <NA> Març 1… 2019 3 4 NA
## 8 1 23346 NA 919 <NA> Març 1… 2019 3 4 NA
## 9 1 23347 NA 919 <NA> Març 1… 2019 3 4 NA
## 10 1 23348 NA 919 <NA> Març 1… 2019 3 4 NA
## # … with 4,490 more rows, 1,082 more variables: HORA_FIN <time>,
## # DATA_INI <date>, DATA_FIN <date>, DURADA <dbl>, FASE <fct>,
## # ENQUESTADOR_CODI <dbl>, ENQUESTADOR_SEXE <fct>, ENQUESTADOR_EDAT <dbl>,
## # ENQUESTADOR_ESTUDIS <fct>, ENQUESTADOR_NACIONALITAT <fct>,
## # NUM_QUEST_CAMP <dbl>, PROVINCIA <fct>, HABITAT <fct>, MUNICIPI <fct>,
## # COMARCA <fct>, CLUSTER <dbl>, ID_RUTA <dbl>, SECCIO_TEORICA <dbl>,
## # CONF_SECC <fct>, SECCIO_REAL <dbl>, DOMICILI_PARTICULAR <fct>, …
By default CEOdata()
incorporates new variables to the
original matrix. Variables that are created for convenience, such as the
date of the survey. The CEO data not always provides a day of the month.
In that case, 28 is used. These variables appear at the end of the
dataset and can be distinguished from the original CEO variables because
only the first letter is capitalized.
## [1] "CIRCUIT_1035_5" "CIRCUIT_1035_6" "CIRCUIT_1035_7" "CIRCUIT_1035_8"
## [5] "CIRCUIT_1035_9" "Data"
In case of desiring all variable names to be lowercase, one can
simply convert them with tolower()
:
CEOmeta()
: Access to the metadata of studies and
surveysThe function CEOmeta
allows to easily retrieve, search
and restrict by time the list of all the surveys produced by the CEO,
which amounts to more than a thousand as of early 2022.
When called alone, the function downloads the latest version of the
metadata published by the center, in a transparent way, and caching its
content so that any subsequent calls in the same R
session
do not need to download it again.
## # A tibble: 1,180 × 28
## REO Titol e…¹ Titol…² Metod…³ Metod…⁴ Objec…⁵ Ambit…⁶ Cost Promo…⁷ Execu…⁸
## <fct> <chr> <chr> <fct> <fct> <chr> <fct> <dbl> <chr> <chr>
## 1 1032 Òmnibus … Òmnibu… quanti… presen… L'obje… Catalu… NA Centre… Sigma …
## 2 1031 Baròmetr… Baròme… quanti… presen… Recoll… Catalu… 56900 Centre… Gabine…
## 3 1030 El model… El mod… qualit… entrev… - Iden… Catalu… NA Depart… Depart…
## 4 1029 Estudi q… Estudi… qualit… entrev… Explor… Catalu… NA Depart… Depart…
## 5 1028 Models d… Models… qualit… entrev… Detect… Catalu… NA Depart… Depart…
## 6 1027 Índex de… Índex … quanti… presen… Indica… Catalu… NA Depart… Psyma
## 7 1026 Estudi d… Estudi… quanti… telèfon Obteni… Catalu… NA Depart… UTE Ga…
## 8 1025 Estudi d… Estudi… quanti… telèfon Obteni… Catalu… NA Depart… UTE Ga…
## 9 1024 Estudi d… Estudi… quanti… telèfon Mesura… Catalu… NA Depart… UTE Ga…
## 10 1023 Estudi d… Estudi… quanti… telèfon Mesura… Catalu… NA Depart… UTE Ga…
## # … with 1,170 more rows, 18 more variables: `Promotors estudi` <chr>,
## # `Executors estudi` <chr>, `Data de treball de camp` <chr>,
## # `Dia inici treball de camp` <date>, `Dia final treball de camp` <date>,
## # Univers <chr>, Mostra <chr>, `Mostra estudis quantitatius` <dbl>,
## # `Mostra estudis qualitatius` <chr>, `Error mostral` <chr>,
## # `Error mostral (numèric)` <chr>, Resum <chr>, `Any d'entrada al REO` <int>,
## # `Data d'alta al REO` <date>, Descriptors <chr>, Enllac <chr>, …
In order to get the metadata of a specific study, the
reo
argument can be used:
## # A tibble: 1 × 28
## REO Titol en…¹ Titol…² Metod…³ Metod…⁴ Objec…⁵ Ambit…⁶ Cost Promo…⁷ Execu…⁸
## <fct> <chr> <chr> <fct> <fct> <chr> <fct> <dbl> <chr> <chr>
## 1 746 Baròmetre… Baròme… quanti… presen… Recoll… Catalu… 45500 Centre… Opinòm…
## # … with 18 more variables: `Promotors estudi` <chr>, `Executors estudi` <chr>,
## # `Data de treball de camp` <chr>, `Dia inici treball de camp` <date>,
## # `Dia final treball de camp` <date>, Univers <chr>, Mostra <chr>,
## # `Mostra estudis quantitatius` <dbl>, `Mostra estudis qualitatius` <chr>,
## # `Error mostral` <chr>, `Error mostral (numèric)` <chr>, Resum <chr>,
## # `Any d'entrada al REO` <int>, `Data d'alta al REO` <date>,
## # Descriptors <chr>, Enllac <chr>, `Enllac matriu de dades` <chr>, …
The first relevant argument for CEOmeta()
is
search
, which is a built-in simple search engine that goes
through the columns of the metadata containing potential descriptive
information (title, summary, objectives and tags -descriptors-) and
returns the studies that contain such keyword.
## Looking for entries with: medi ambient
## # A tibble: 46 × 28
## REO Titol …¹ Titol…² Metod…³ Metod…⁴ Objec…⁵ Ambit…⁶ Cost Promo…⁷ Execu…⁸
## <fct> <chr> <chr> <fct> <fct> <chr> <fct> <dbl> <chr> <chr>
## 1 1017 Seguime… Seguim… quanti… telèfon Conèix… Catalu… NA Depart… Fieldw…
## 2 1010 Enquest… Enques… quanti… intern… Desenv… Catalu… 8200 Centre… Soluci…
## 3 1006 Seguime… Seguim… quanti… telèfon Conèix… Catalu… 14950 Depart… UTE MD…
## 4 973 Seguime… Seguim… quanti… telèfon Conèix… Catalu… 14950 Depart… Gabine…
## 5 941 Seguime… Seguim… quanti… telèfon Conèix… Catalu… 14950 Depart… UTE MD…
## 6 876 Baròmet… Baròme… quanti… intern… Conèix… Catalu… 15428. Depart… Instit…
## 7 875 Seguime… Seguim… quanti… telèfon Conèix… Catalu… 14700 Depart… Gabine…
## 8 865 Seguime… Seguim… quanti… telèfon Conèix… Catalu… 14700 Depart… Fieldw…
## 9 819 Baròmet… Baròme… quanti… telèfon Quanti… Catalu… 17120 Depart… MDK, I…
## 10 807 Seguime… Seguim… quanti… telèfon Conèix… Catalu… 9850 Depart… Gabine…
## # … with 36 more rows, 18 more variables: `Promotors estudi` <chr>,
## # `Executors estudi` <chr>, `Data de treball de camp` <chr>,
## # `Dia inici treball de camp` <date>, `Dia final treball de camp` <date>,
## # Univers <chr>, Mostra <chr>, `Mostra estudis quantitatius` <dbl>,
## # `Mostra estudis qualitatius` <chr>, `Error mostral` <chr>,
## # `Error mostral (numèric)` <chr>, Resum <chr>, `Any d'entrada al REO` <int>,
## # `Data d'alta al REO` <date>, Descriptors <chr>, Enllac <chr>, …
It is also possible to pass more than one value to
search
, so that the search includes them (either one of
them OR any other).
## Looking for entries with: medi ambient OR municipi
## # A tibble: 50 × 28
## REO Titol …¹ Titol…² Metod…³ Metod…⁴ Objec…⁵ Ambit…⁶ Cost Promo…⁷ Execu…⁸
## <fct> <chr> <chr> <fct> <fct> <chr> <fct> <dbl> <chr> <chr>
## 1 1017 Seguime… Seguim… quanti… telèfon Conèix… Catalu… NA Depart… Fieldw…
## 2 1010 Enquest… Enques… quanti… intern… Desenv… Catalu… 8200 Centre… Soluci…
## 3 1006 Seguime… Seguim… quanti… telèfon Conèix… Catalu… 14950 Depart… UTE MD…
## 4 973 Seguime… Seguim… quanti… telèfon Conèix… Catalu… 14950 Depart… Gabine…
## 5 941 Seguime… Seguim… quanti… telèfon Conèix… Catalu… 14950 Depart… UTE MD…
## 6 876 Baròmet… Baròme… quanti… intern… Conèix… Catalu… 15428. Depart… Instit…
## 7 875 Seguime… Seguim… quanti… telèfon Conèix… Catalu… 14700 Depart… Gabine…
## 8 865 Seguime… Seguim… quanti… telèfon Conèix… Catalu… 14700 Depart… Fieldw…
## 9 819 Baròmet… Baròme… quanti… telèfon Quanti… Catalu… 17120 Depart… MDK, I…
## 10 807 Seguime… Seguim… quanti… telèfon Conèix… Catalu… 9850 Depart… Gabine…
## # … with 40 more rows, 18 more variables: `Promotors estudi` <chr>,
## # `Executors estudi` <chr>, `Data de treball de camp` <chr>,
## # `Dia inici treball de camp` <date>, `Dia final treball de camp` <date>,
## # Univers <chr>, Mostra <chr>, `Mostra estudis quantitatius` <dbl>,
## # `Mostra estudis qualitatius` <chr>, `Error mostral` <chr>,
## # `Error mostral (numèric)` <chr>, Resum <chr>, `Any d'entrada al REO` <int>,
## # `Data d'alta al REO` <date>, Descriptors <chr>, Enllac <chr>, …
In addition to the built-in argument to search through the columns of
the survey title, the study title, the objectives, the summary and the
tags (descriptors), it is possible to combine CEOmeta()
with dplyr
’s filter()
to limit the results of
studies returned.
For example, to get the studies that have been performed using Internet to get the data:
## # A tibble: 39 × 28
## REO Titol e…¹ Titol…² Metod…³ Metod…⁴ Objec…⁵ Ambit…⁶ Cost Promo…⁷ Execu…⁸
## <fct> <chr> <chr> <fct> <fct> <chr> <fct> <dbl> <chr> <chr>
## 1 1020 Polaritz… Polari… quanti… intern… Analit… Espanya NA Instit… Soluci…
## 2 1018 Enquesta… Enques… quanti… intern… Avalua… Catalu… NA Centre… Centre…
## 3 1016 Enquesta… Enques… quanti… intern… Dispos… Catalu… NA Observ… MDK, I…
## 4 1010 Enquesta… Enques… quanti… intern… Desenv… Catalu… 8200 Centre… Soluci…
## 5 1000 Enquesta… Enques… quanti… intern… Recoll… Catalu… 18516 Centre… Soluci…
## 6 995 Enquesta… Enques… quanti… intern… Avalua… Catalu… NA Centre… Centre…
## 7 993 Enquesta… Enques… quanti… intern… Avalua… Catalu… NA Centre… Centre…
## 8 989 Enquesta… Enques… quanti… intern… Avalua… Catalu… 0 Depart… Centre…
## 9 969 Estudi d… Estudi… quanti… intern… La fin… Catalu… NA Depart… Depart…
## 10 968 Estudi d… Estudi… quanti… intern… La fin… Catalu… NA Depart… Depart…
## # … with 29 more rows, 18 more variables: `Promotors estudi` <chr>,
## # `Executors estudi` <chr>, `Data de treball de camp` <chr>,
## # `Dia inici treball de camp` <date>, `Dia final treball de camp` <date>,
## # Univers <chr>, Mostra <chr>, `Mostra estudis quantitatius` <dbl>,
## # `Mostra estudis qualitatius` <chr>, `Error mostral` <chr>,
## # `Error mostral (numèric)` <chr>, Resum <chr>, `Any d'entrada al REO` <int>,
## # `Data d'alta al REO` <date>, Descriptors <chr>, Enllac <chr>, …
Or to get studies with a specific quantitative sample size limit:
## # A tibble: 170 × 28
## REO Titol e…¹ Titol…² Metod…³ Metod…⁴ Objec…⁵ Ambit…⁶ Cost Promo…⁷ Execu…⁸
## <fct> <chr> <chr> <fct> <fct> <chr> <fct> <dbl> <chr> <chr>
## 1 990 IPLAENSA… IPLAEN… quanti… telèfon "La fi… Catalu… NA Depart… Depart…
## 2 989 Enquesta… Enques… quanti… intern… "Avalu… Catalu… 0 Depart… Centre…
## 3 984 iPLAENSA… iPLAEN… quanti… telèfon "La fi… Catalu… NA Depart… Depart…
## 4 983 iPLAENSA… iPLAEN… quanti… telèfon "La fi… Catalu… NA Depart… Depart…
## 5 964 Enquesta… Enques… quanti… autoad… "Estim… Catalu… 4065 Depart… Depart…
## 6 963 Enquesta… Enques… quanti… autoad… "Estim… Catalu… 4065 Depart… Depart…
## 7 957 Avaluaci… Avalua… quanti… presen… "Avalu… Catalu… 5092 Depart… Psyma
## 8 950 Enquesta… Enques… quanti… telèfon "Estim… Catalu… 3600 Depart… Depart…
## 9 933 iPLAENSA… iPLAEN… quanti… telèfon "La fi… Catalu… NA Depart… Depart…
## 10 930 iPLAENSA… iPLAEN… quanti… telèfon "La fi… Catalu… NA Depart… Depart…
## # … with 160 more rows, 18 more variables: `Promotors estudi` <chr>,
## # `Executors estudi` <chr>, `Data de treball de camp` <chr>,
## # `Dia inici treball de camp` <date>, `Dia final treball de camp` <date>,
## # Univers <chr>, Mostra <chr>, `Mostra estudis quantitatius` <dbl>,
## # `Mostra estudis qualitatius` <chr>, `Error mostral` <chr>,
## # `Error mostral (numèric)` <chr>, Resum <chr>, `Any d'entrada al REO` <int>,
## # `Data d'alta al REO` <date>, Descriptors <chr>, Enllac <chr>, …
Metadata can be retrieved for a specific period of time, by using the
arguments date_start
and date_end
, also using
the YYYY-MM-DD format. In this case the dates that are taken into
account are dates where the study gets into the records, not the
fieldwork dates.
## # A tibble: 45 × 28
## REO Titol e…¹ Titol…² Metod…³ Metod…⁴ Objec…⁵ Ambit…⁶ Cost Promo…⁷ Execu…⁸
## <fct> <chr> <chr> <fct> <fct> <chr> <fct> <dbl> <chr> <chr>
## 1 954 Baròmetr… Baròme… quanti… presen… "Recol… Catalu… 40365 Centre… Gabine…
## 2 953 Enquesta… Enques… quanti… intern… "Avalu… Catalu… NA Centre… Centre…
## 3 952 Percepci… Percep… quanti… presen… "Recol… Espanya 98820 Depart… Instit…
## 4 951 Cosmopol… Cosmop… quanti… presen… "Ident… Catalu… 41820 Centre… Gabine…
## 5 950 Enquesta… Enques… quanti… telèfon "Estim… Catalu… 3600 Depart… Depart…
## 6 949 Enquesta… Enques… quanti… intern… "Els d… Catalu… 46000 Depart… Ipsos …
## 7 948 Enquesta… Enques… quanti… telèfon "Mesur… Catalu… 9680 Centre… UTE MD…
## 8 947 Baròmetr… Baròme… quanti… telèfon "Conèi… Catalu… NA Depart… UTE Ga…
## 9 946 Òmnibus … Òmnibu… quanti… presen… "Obten… Catalu… 32208 Centre… Gabine…
## 10 945 Baròmetr… Baròme… quanti… intern… "Conèi… Europa 28380 Depart… More t…
## # … with 35 more rows, 18 more variables: `Promotors estudi` <chr>,
## # `Executors estudi` <chr>, `Data de treball de camp` <chr>,
## # `Dia inici treball de camp` <date>, `Dia final treball de camp` <date>,
## # Univers <chr>, Mostra <chr>, `Mostra estudis quantitatius` <dbl>,
## # `Mostra estudis qualitatius` <chr>, `Error mostral` <chr>,
## # `Error mostral (numèric)` <chr>, Resum <chr>, `Any d'entrada al REO` <int>,
## # `Data d'alta al REO` <date>, Descriptors <chr>, Enllac <chr>, …
In addition, to the search engine and the restriction by time
CEOmeta()
also allows to automatically open the relevant
URLs at the CEO domain that contain the details of the studies gathered
with the function. This can be done setting the browse
argument to TRUE
. However, there is a soft limitation of
only 10 URLs to be opened, unless the user forces to really open all of
them (proceed with caution, as this may open many tabs in your browser
and leave your computer out of RAM in some scenarios of RAM black holes,
such as Chrome).
To open a specific REO, a simpler call with its specific identifier can be used:
It is also possible to specify an alternative language, so the default Catalan pages are substituted by the automatic translations provided by Apertium (for Occitan/Aranese) or Google Translate.
CEOsearch()
: Access to the variable and value
labelsContrary to CEOdata()
and CEOmeta()
,
CEOsearch()
needs at least one argument: the survey data
(microdata) for which we want to extract the variable labels and the
value labels. By default it provides the variable labels in a tidy
object:
## # A tibble: 1,092 × 2
## Variable Label
## <chr> <chr>
## 1 PONDERA Coeficients de ponderació
## 2 ORDRECINE Número d'ordre de registre cine
## 3 ORDRE_REVISADA Número d'ordre de registre original (variable anonimitzada)
## 4 REO Número de registre
## 5 METODOLOGIA Metodologia d'enquestació
## 6 BOP_NUM Número d'ordre del baròmetre
## 7 ANY Any de realització del baròmetre
## 8 MES Mes de realització del baròmetre
## 9 DIA Dia
## 10 HORA_INI Hora d'inici de l'entrevista (variable anonimitzada)
## # … with 1,082 more rows
Equivalently, the use of where = "values"
provides with
a tidy object containing the value labels. Notice that in this case the
variable names are repeated to accommodate each of the different value
labels.
## # A tibble: 16,034 × 2
## Variable Value
## <fct> <fct>
## 1 METODOLOGIA Presencial
## 2 METODOLOGIA Telefònica
## 3 METODOLOGIA En línia
## 4 BOP_NUM Març 14 - 746
## 5 BOP_NUM Oct. 14 -758
## 6 BOP_NUM Feb 15 -774
## 7 BOP_NUM Juny 15 -795
## 8 BOP_NUM Oct. 15 -804
## 9 BOP_NUM Feb. 16 -816
## 10 BOP_NUM Juny 16 -826
## # … with 16,024 more rows
Just like with the CEOmeta()
, CEOsearch()
has a simple built-in search facility that allows to retrieve only the
rows that match a specific keyword(s). In the following example, we
restrict the variables to those that contain “edat” (age).
## Looking for entries with: edat
## # A tibble: 18 × 2
## Variable Label
## <chr> <chr>
## 1 ENQUESTADOR_EDAT Edat de entrevistador/a
## 2 EDAT Edat
## 3 EDAT_GR Grups d'edat
## 4 EDAT_CEO Grups d'edat reagrupada (recodificació grups…
## 5 INF_POL_OBJ_RANG_ESCOLARITZACIO De quina edat a quina edat és obligatori l’e…
## 6 INF_POL_OBJ_INI_ESCOLARITZACIO De quina edat a quina edat és obligatori l’e…
## 7 INF_POL_OBJ_FI_ESCOLARITZACIO De quina edat a quina edat és obligatori l’e…
## 8 CRISI_ATUR_FAMILIAR En els últims dos anys, com a conseqüència d…
## 9 EDAT_1 EDAT_1 (variable anonimitzada)
## 10 EDAT_2 EDAT_2 (variable anonimitzada)
## 11 EDAT_3 EDAT_3 (variable anonimitzada)
## 12 EDAT_4 EDAT_4 (variable anonimitzada)
## 13 EDAT_5 EDAT_5 (variable anonimitzada)
## 14 EDAT_6 EDAT_6 (variable anonimitzada)
## 15 EDAT_7 EDAT_7 (variable anonimitzada)
## 16 EDAT_8 EDAT_8 (variable anonimitzada)
## 17 EDAT_9 EDAT_9 (variable anonimitzada)
## 18 EDAT_10 EDAT_10 (variable anonimitzada)
Finally, an English translation of the variable labels/values is
provided if the argument translate
is set to
TRUE
, by opening a browser tab with the translations.
## Looking for entries with: edat
## # A tibble: 18 × 2
## Variable Label
## <chr> <chr>
## 1 ENQUESTADOR_EDAT Edat de entrevistador/a
## 2 EDAT Edat
## 3 EDAT_GR Grups d'edat
## 4 EDAT_CEO Grups d'edat reagrupada (recodificació grups…
## 5 INF_POL_OBJ_RANG_ESCOLARITZACIO De quina edat a quina edat és obligatori l’e…
## 6 INF_POL_OBJ_INI_ESCOLARITZACIO De quina edat a quina edat és obligatori l’e…
## 7 INF_POL_OBJ_FI_ESCOLARITZACIO De quina edat a quina edat és obligatori l’e…
## 8 CRISI_ATUR_FAMILIAR En els últims dos anys, com a conseqüència d…
## 9 EDAT_1 EDAT_1 (variable anonimitzada)
## 10 EDAT_2 EDAT_2 (variable anonimitzada)
## 11 EDAT_3 EDAT_3 (variable anonimitzada)
## 12 EDAT_4 EDAT_4 (variable anonimitzada)
## 13 EDAT_5 EDAT_5 (variable anonimitzada)
## 14 EDAT_6 EDAT_6 (variable anonimitzada)
## 15 EDAT_7 EDAT_7 (variable anonimitzada)
## 16 EDAT_8 EDAT_8 (variable anonimitzada)
## 17 EDAT_9 EDAT_9 (variable anonimitzada)
## 18 EDAT_10 EDAT_10 (variable anonimitzada)
Of course, variable labels and values can be merged into a single
object using a combination of join
and
CEOsearch()
:
## Joining, by = "Variable"
## # A tibble: 16,118 × 3
## Variable Label Value
## <chr> <chr> <fct>
## 1 PONDERA Coeficients de ponderació <NA>
## 2 ORDRECINE Número d'ordre de registre cine <NA>
## 3 ORDRE_REVISADA Número d'ordre de registre original (variable anonimitz… <NA>
## 4 REO Número de registre <NA>
## 5 METODOLOGIA Metodologia d'enquestació Pres…
## 6 METODOLOGIA Metodologia d'enquestació Tele…
## 7 METODOLOGIA Metodologia d'enquestació En l…
## 8 BOP_NUM Número d'ordre del baròmetre Març…
## 9 BOP_NUM Número d'ordre del baròmetre Oct.…
## 10 BOP_NUM Número d'ordre del baròmetre Feb …
## # … with 16,108 more rows
The development of CEOdata
(track changes, propose
improvements, report bugs) can be followed at github.
If using the data and the package, please cite and acknowledge properly the CEO and the package, respectively.