#> 1 235 1190 A ESTADO, SISTEMA POLTICO "" 001
#> 2 221 92 A.1 CONSTITUCIN E INSTITUCIONES "" 001_001
#> 3 222 24 A.1.01 CONSTITUCIN "" 001_00…
#> 4 223 6 A.1.01.01 CONOCIMIENTO DE LA CONSTITUCIN "" 001_00…
#> 5 2535 1 A.1.01.01.001 GRADO DE CONOCIMIENTO DE LA CO… " 6 2977 1 A.1.01.01.002 GRADO DE CONOCIMIENTO DE LA CO… "
7 2978 1 A.1.01.01.004 GRADO DE ESFUERZO DE LOS GOBIE… "
8 16109 1 A.1.01.01.009 ACUERDO CON DISTINTOS MEDIOS D… "
9 16110 1 A.1.01.01.010 ACUERDO CON DISTINTOS MEDIOS D… "
10 16112 1 A.1.01.01.011 ACUERDO CON DISTINTOS MEDIOS D… "
# 4,423 more rows
#> # Use `print(n = ...)` to see more rows
```
The third group of functions are used to import the data directly into R.
``` r
# Read a survey study
df <- read_cis("3411")
#> probando la URL 'https://www.cis.es/documents/d/cis/MD3411'
#> Content type 'application/zip' length 14194752 bytes (13.5 MB)
#> downloaded 13.5 MB
print(df)
#> Invalid date string (length=9): 11 042 23
#> # A tibble: 29,201 × 216
#> ESTUDIO REGISTRO CUES CCAA PROV MUN CAPITAL TAMUNI ENTREV
#>
#> 1 3411 [3411] 492777 29043 1 [Andalucí… 4 [Alm… 0 [Mun… 3 [Otr… 1 [Men… 0 [Ano…
#> 2 3411 [3411] 70655 5848 1 [Andalucí… 4 [Alm… 0 [Mun… 3 [Otr… 1 [Men… 0 [Ano…
#> 3 3411 [3411] 46423 3893 1 [Andalucí… 4 [Alm… 0 [Mun… 3 [Otr… 3 [10.… 0 [Ano…
#> 4 3411 [3411] 103464 8711 1 [Andalucí… 4 [Alm… 0 [Mun… 3 [Otr… 3 [10.… 0 [Ano…
#> 5 3411 [3411] 112810 9517 1 [Andalucí… 4 [Alm… 0 [Mun… 3 [Otr… 3 [10.… 0 [Ano…
#> 6 3411 [3411] 126567 10736 1 [Andalucí… 4 [Alm… 0 [Mun… 3 [Otr… 3 [10.… 0 [Ano…
#> 7 3411 [3411] 137692 11573 1 [Andalucí… 4 [Alm… 0 [Mun… 3 [Otr… 3 [10.… 0 [Ano…
#> 8 3411 [3411] 182178 14839 1 [Andalucí… 4 [Alm… 0 [Mun… 3 [Otr… 3 [10.… 0 [Ano…
#> 9 3411 [3411] 216764 16793 1 [Andalucí… 4 [Alm… 0 [Mun… 3 [Otr… 3 [10.… 0 [Ano…
#> 10 3411 [3411] 237655 17918 1 [Andalucí… 4 [Alm… 0 [Mun… 3 [Otr… 3 [10.… 0 [Ano…
#> # 29,191 more rows
#> # 207 more variables: TIPO_TEL , SEXO , EDAD ,
#> # P0A , ECOPER , ECOESP , MEDIO_1 ,
#> # MEDIO_2 , LEEPRENSA , VETELE , OYERADIO ,
#> # PRENSA , P3AR , TELEVISION , P3BR ,
#> # RADIO , P3CR , GESTIONGOB , GESTIONOPO ,
#> # PROBVOTO , VOTOCORREO , PROBPARTIDOS_1 , …
#> # Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names
# Read a timeseries
df_series <- read_series("2092")
print(df_series)
#> # A tibble: 1,115 × 16
#> id codigo_serie titulo pregunta muestra notas multiVariable estudio fecha
#>
#> 1 2092 K.1.02.02.002 VALORAC… " 2 2092 K.1.02.02.002 VALORAC… "
3 2092 K.1.02.02.002 VALORAC… "
4 2092 K.1.02.02.002 VALORAC… "
5 2092 K.1.02.02.002 VALORAC… "
6 2092 K.1.02.02.002 VALORAC… "
7 2092 K.1.02.02.002 VALORAC… "
8 2092 K.1.02.02.002 VALORAC… "
9 2092 K.1.02.02.002 VALORAC… "
10 2092 K.1.02.02.002 VALORAC… "
# 1,105 more rows
#> # 7 more variables: codigo_variable , idEstudio , idPregunta ,
#> # idVariable , response_categories , response_values ,
#> # X.N.
#> # Use `print(n = ...)` to see more rows
```
## SSL certificate error on Ubuntu
Due to an issue with the SSL certificate of CIS website the following error may be thrown on Ubuntu systems:
```
SSL peer certificate or SSH remote key was not OK: [www.cis.es] SSL certificate problem: unable to get local issuer certificate
```
To solve this problem the user must disable the SSL peer verification option. To do so the following command must be run once in each session:
```
httr::set_config(httr::config(ssl_verifypeer = 0L))
```
I understand that disabling the SSL peer verification option is not ideal as it may be a security risk, but this is not an `opencis` issue, it's a problem on the CIS end side. It has to do with the security certificate presented by the CIS website not been issued by a trusted certificate authority.