CEOdata {CEOdata} | R Documentation |
Import datasets / microdata from the "Centre d'Estudis d'Opinio"
Description
Easy and convenient access to the datasets / microdata of the "Centre d'Estudis d'Opinio", the Catalan institution for polling and public opinion. The package uses the data stored in the servers of the CEO and returns it in a tidy format (tibble).
Easy and convenient access to the datasets / microdata of the "Centre d'Estudis d'Opinio", the catalan institution for polling and public opinion. The package uses the data stored in the servers of the CEO and returns it in a tidy format (tibble).
Usage
CEOdata(
kind = "barometer",
reo = NA,
raw = FALSE,
extra_variables = TRUE,
date_start = NA,
date_end = NA
)
Arguments
kind |
Character vector with the sort of microdata required. Defaults to "barometer", that contains the whole set of Barometers from 2014 (presential interviews). "barometer_until_2013" contains the interviews performed by phone until 2013, with a somewhat different questionnaire and structure. For such dataset you need a third-party software installed in your computer to be able to uncompress the RAR original file. It is the option by default. But if a specific reo study is requested in the |
reo |
Character vector of length one that allows to get the dataset of a specific REO study (Registre d'Estudis d'Opinio, the internal register ID used by the CEO) to download. By default (when |
raw |
Logical value to indicate if SPSS labels are transformed into factors. Defaults to FALSE. Otherwise, when TRUE, it returns the matrices as imported by haven::read_spss() without modification. Does not apply to data from singular REOs, only to barometers retrieved using |
extra_variables |
Logical value as to whether include (default) complementary variables such as date (Data). Defaults to TRUE. Names of such new variables only use upper case in the first letter. Extra variables are added at the end. Does not apply to data from singular REOs, only to barometers retrieved using |
date_start |
Character vector with a starting date ("YYYY-MM-DD") for the data. It only applies to the barometers retrieved using |
date_end |
Character vector with an end date ("YYYY-MM-DD") for the data. It only applies to the barometers retrieved using |
Details
It works either by specifying the kind of merged barometer (using the
kind
argument), or either providing a singular study (using the
reo
argument).
Value
A tibble with the individuals' responses to the questionnaire retrieved.
References
http://xavier-fim.net/packages/CEOdata/.
Examples
## Not run:
# Get the merged barometer from 2014, by default (assume kind = "barometer").
d <- CEOdata()
# Get the number of individuals surveyed and the number of variables recorded.
dim(d)
# Get the identifiers of the different Barometers retrieved
unique(d$BOP_NUM)
# Get a specific study
d746 <- CEOdata(reo = "746")
## End(Not run)