¡Recuerda poner el directorio!
setwd("/Users/anaescoto/Dropbox/2019/Cursos ESA/UCA_R")
Vamos a importar de nuevo nuestra base de IPC
library(readxl) #No olvides llamar la librería
IPC <- read_excel("./datos/IPC.xlsx", sheet = "para_importar")
#View(IPC)
Muchas veces nos toca manipular nuestras bases de datos. La consulta nos dio una versión “wide” de la base de datos, donde las filas son los tipos de gastos. No podremos hacer un gráfico que nos represente el IPC a lo largo del tiempo, una gráfica muy solicitada por los economistas.
Para ello utilizaremos la opciones de “spread” y “gather” que viene en tidyr de tidyverse
library(tidyr)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
#Queremos las variables que nos están dando nuestra info
#Esto nos dará un vector de todas las fechas
vars<-IPC %>%
select(-etiqueta_grupo) %>%
names()
ipc_long1<-gather(IPC, vars, key="fecha", value="indices" )
Es decir el gather “agarra” la base según el vector “var”, y lo pone en “key” y los valores estarán en la columna índices.
Pero quizás queremos volver a un wide, o uno diferente. Quisiéramos que los diferentes tipos de gasto o consumo tuvieran su propia columna. Esto se hace con el comando “spread”.
ipc_wide<-spread(ipc_long1,key="etiqueta_grupo", value = "indices")
Spoiler: Este es uno de los comandos más útiles cuando queremos graficar, sobre todo cuando lo hacemos con ggplot2. Se va haciendo más fácil con la práctica. Pero es bueno tener a la mano “la copia” https://github.com/rstudio/cheatsheets/blob/master/data-import.pdf
¡El problema del tidyverse! CAMBIA https://www.r-bloggers.com/tidyverse-users-gather-spread-are-on-the-way-out/
¿Qué hacemos con las fechas? ¡Quedaron en orden alfabético!
ipc_wide$month<-substr(ipc_wide$fecha, 1, 3)
ipc_wide$year<-substr(ipc_wide$fecha, 4, 8)
Esto nos da la idea para recodificar (otra función muy importante)
ipc_wide$month2= recode(ipc_wide$month,
ene="01", feb="02", mar="03", abr="04",
may="05", jun="06", jul="07", ago="08",
sep="09", oct="10", nov="11", dic="12")
Cuando trabajamos con series de tiempo es muy útil la función “as.Date”.
ipc_wide$date0<-paste("01",ipc_wide$month2,ipc_wide$year,sep ="") #necesitamos un día, asumimos 1
ipc_wide$date<-as.Date(ipc_wide$date0, format="%d%m%Y")
ipc_wide <- ipc_wide[order(ipc_wide$date),]
Hoy sí… a graficar
plot(ipc_wide$date,ipc_wide$alimentos_bebidas)
El comando ts() nos ayuda a graficar nuestras series de tiempo. El argumento de frecuencia, nos dice la estacionalidad. El 12 refiere a datos mensuales; trimestrales es 4; anuales es 1
ipc_timeserie <- ts(ipc_wide$alimentos_bebidas, frequency=12, start=c(2009,1))
class(ipc_timeserie)
## [1] "ts"
ts.plot(ipc_timeserie)
El gráfico es muy parecido. Pero si checas hoy puedes hacer operaciones de “lags” y diferencias de manera mucho más sencilla
ts.plot(diff(ipc_timeserie), differences=1) #orden de la diferencia
ts.plot(diff(ipc_timeserie, lag=2)) #rezago
Hay “paquetes” con datos y series de tiempo.
#install.packages('WDI')
library(WDI)
“El Banco Mundial pone a disposición una gran cantidad de datos excelentes de los Indicadores de Desarrollo Mundial a través de su API web. El paquete WDI para R facilita la búsqueda y descarga de series de datos desde WDI”.
WDIsearch('gender')
## indicator
## [1,] "5.51.01.07.gender"
## [2,] "UIS.SLE.1.GPI"
## [3,] "UIS.SLE.0.GPI"
## [4,] "UIS.SR.1.GLAST.GPI"
## [5,] "UIS.SR.1.G5.GPI"
## [6,] "UIS.SR.1.G4.GPI"
## [7,] "UIS.SLEN.12.GPI"
## [8,] "UIS.SLE.56.GPI"
## [9,] "UIS.SLE.4.GPI"
## [10,] "UIS.SLE.23.GPI"
## [11,] "UIS.SLE.1t6.GPI"
## [12,] "UIS.SLE.123.GPI"
## [13,] "UIS.NART.2.Q5.GPIA"
## [14,] "UIS.NART.2.Q4.GPIA"
## [15,] "UIS.NART.2.Q3.GPIA"
## [16,] "UIS.NART.2.Q2.GPIA"
## [17,] "UIS.NART.2.Q1.GPIA"
## [18,] "UIS.NART.2.GPIA"
## [19,] "UIS.NARA.1.URB.GPIA"
## [20,] "UIS.NARA.1.RUR.GPIA"
## [21,] "UIS.EA.3T6.AG25T99.GPI"
## [22,] "UIS.EA.2T6.AG25T99.GPI"
## [23,] "UIS.EA.1T6.AG25T99.GPI"
## [24,] "PRJ.MYS.25UP.GPI"
## [25,] "SG.NOD.CONS"
## [26,] "SG.LAW.NODC.HR"
## [27,] "BI.WAG.PREM.PB.MA"
## [28,] "BI.WAG.PREM.PB.FE"
## [29,] "BI.EMP.TOTL.PB.MA.ZS"
## [30,] "BI.EMP.TOTL.PB.FE.ZS"
## [31,] "BI.EMP.PWRK.PB.MA.ZS"
## [32,] "BI.EMP.PWRK.PB.FE.ZS"
## [33,] "UIS.NAR.2.Q5.GPIA"
## [34,] "UIS.NAR.2.Q4.GPIA"
## [35,] "UIS.NAR.2.Q3.GPIA"
## [36,] "UIS.NAR.2.Q2.GPIA"
## [37,] "UIS.NAR.2.Q1.GPIA"
## [38,] "UIS.NAR.2.GPIA"
## [39,] "UIS.NAR.1.URB.GPIA"
## [40,] "UIS.NAR.1.RUR.GPIA"
## [41,] "SE.ENR.TERT.FM.ZS"
## [42,] "SE.ENR.SECO.FM.ZS"
## [43,] "SE.ENR.PRSC.FM.ZS"
## [44,] "SE.ENR.PRIM.FM.ZS"
## [45,] "SE.ADT.1524.LT.FM.ZS"
## [46,] "UIS.AIR.2.GPV.GPI"
## [47,] "UIS.AIR.2.GPV.GLAST.GPI"
## [48,] "UIS.AIR.1.GPI"
## [49,] "UIS.AIR.1.Glast.GPI"
## [50,] "UIS.NARA.1.Q5.GPIA"
## [51,] "UIS.NARA.1.Q4.GPIA"
## [52,] "UIS.NARA.1.Q3.GPIA"
## [53,] "UIS.NARA.1.Q2.GPIA"
## [54,] "UIS.NARA.1.Q1.GPIA"
## [55,] "UIS.NARA.1.GPIA"
## [56,] "UIS.NAR.2.URB.GPIA"
## [57,] "UIS.NAR.2.RUR.GPIA"
## [58,] "PRJ.MYS.15UP.GPI"
## [59,] "UIS.REPP.2.GPV.GPI"
## [60,] "UIS.REPP.1.GPI"
## [61,] "UIS.GGR.5.A.GPI"
## [62,] "UIS.GGR.2.GPI"
## [63,] "UIS.GGR.1.GPI"
## [64,] "UIS.GER.4.GPI"
## [65,] "UIS.GER.3.GPI"
## [66,] "UIS.GER.2.GPI"
## [67,] "UIS.GER.1t6.GPI"
## [68,] "UIS.GER.12.GPI"
## [69,] "UIS.GER.0.GPI"
## [70,] "UIS.NAR.1.Q5.GPIA"
## [71,] "UIS.NAR.1.Q4.GPIA"
## [72,] "UIS.NAR.1.Q3.GPIA"
## [73,] "UIS.NAR.1.Q2.GPIA"
## [74,] "UIS.NAR.1.Q1.GPIA"
## [75,] "UIS.NAR.1.GPIA"
## [76,] "UIS.LR.AG65.GPI"
## [77,] "UIS.LR.AG25T64.GPI"
## [78,] "UIS.LR.AG15T99.GPI"
## [79,] "IQ.CPA.GNDR.XQ"
## [80,] "IC.REG.PRRT.LNDADM.GEN.XD.030.DB1719.DFRN"
## [81,] "2.6_PCR.GPI"
## [82,] "2.3_GIR.GPI"
## [83,] "UIS.TRTP.4.GPI"
## [84,] "UIS.TRTP.3.GPI"
## [85,] "UIS.TRTP.23.GPI"
## [86,] "UIS.TRTP.2.GPI"
## [87,] "UIS.TRTP.1.GPI"
## [88,] "UIS.TRTP.02.GPI"
## [89,] "UIS.TRANRA.23.GPV.GPI"
## [90,] "UIS.SR.2.GPV.GLAST.GPI"
## [91,] "UIS.NIR.1.AGM1.GPI"
## [92,] "UIS.NERT.3.GPI"
## [93,] "UIS.NERT.2.GPI"
## [94,] "UIS.NERT.1.GPI"
## [95,] "UIS.NERA.3.GPI"
## [96,] "UIS.NERA.2.GPI"
## [97,] "UIS.NERA.1.GPI"
## [98,] "UIS.NER.23.GPI"
## [99,] "UIS.NER.1.GPI"
## [100,] "UIS.NER.0.GPI"
## [101,] "UIS.NART.2.URB.GPIA"
## [102,] "UIS.NART.2.RUR.GPIA"
## [103,] "UIS.EA.8.AG25T99.GPI"
## [104,] "UIS.EA.7T8.AG25T99.GPI"
## [105,] "UIS.EA.6T8.AG25T99.GPI"
## [106,] "UIS.EA.5T8.AG25T99.GPI"
## [107,] "UIS.EA.4T6.AG25T99.GPI"
## [108,] "UIS.NIRA.1.GPI"
## [109,] "UIS.NIR.1.GPI"
## [110,] "UIS.NIR.1.AGP1.GPI"
## [111,] "UIS.ECDP.1.GPI"
## name
## [1,] "Gender equality"
## [2,] "School life expectancy, primary, gender parity index (GPI)"
## [3,] "School life expectancy, pre-primary, gender parity index (GPI)"
## [4,] "Survival rate to the last grade of primary education, gender parity index (GPI)"
## [5,] "Survival rate to Grade 5 of primary education, gender parity index (GPI)"
## [6,] "Survival rate to Grade 4 of primary education, gender parity index (GPI)"
## [7,] "School life expectancy, primary and lower secondary (excluding repetition), gender parity index (GPI)"
## [8,] "School life expectancy, tertiary, gender parity index (GPI)"
## [9,] "School life expectancy, post-secondary non-tertiary, gender parity index (GPI)"
## [10,] "School life expectancy, secondary, gender parity index (GPI)"
## [11,] "School life expectancy, primary to tertiary, gender parity index (GPI)"
## [12,] "School life expectancy, primary and secondary, gender parity index (GPI)"
## [13,] "UIS: Total net attendance rate, lower secondary, richest quintile, adjusted gender parity index (GPIA)"
## [14,] "UIS: Total net attendance rate, lower secondary, fourth quintile, adjusted gender parity index (GPIA)"
## [15,] "UIS: Total net attendance rate, lower secondary, middle quintile, adjusted gender parity index (GPIA)"
## [16,] "UIS: Total net attendance rate, lower secondary, second quintile, adjusted gender parity index (GPIA)"
## [17,] "UIS: Total net attendance rate, lower secondary, poorest quintile, adjusted gender parity index (GPIA)"
## [18,] "UIS: Total net attendance rate, lower secondary, adjusted gender parity index (GPIA)"
## [19,] "UIS: Adjusted net attendance rate, primary, urban, adjusted gender parity index (GPIA)"
## [20,] "UIS: Adjusted net attendance rate, primary, rural, adjusted gender parity index (GPIA)"
## [21,] "UIS: Percentage of population age 25+ with at least completed upper secondary education (ISCED 3 or higher). Gender Parity Index"
## [22,] "UIS: Percentage of population age 25+ with at least completed lower secondary education (ISCED 2 or higher). Gender Parity Index"
## [23,] "UIS: Percentage of population age 25+ with at least completed primary education (ISCED 1 or higher). Gender Parity Index"
## [24,] "Wittgenstein Projection: Mean Years of Schooling. Age 25+. Gender Gap"
## [25,] "Nondiscrimination clause mentions gender in the constitution (1=yes; 0=no)"
## [26,] "Law mandates nondiscrimination based on gender in hiring (1=yes; 0=no)"
## [27,] "Public sector wage premiums by gender (Male) (compared to all private employees) (%)"
## [28,] "Public sector wage premiums by gender (Female) (compared to all private employees) (%)"
## [29,] "Public sector employment as a share of total employment by gender (Male)"
## [30,] "Public sector employment as a share of total employment by gender (Female)"
## [31,] "Public sector employment as a share of paid employment by gender (Male)"
## [32,] "Public sector employment as a share of paid employment by gender (Female)"
## [33,] "UIS: Net attendance rate, lower secondary, richest quintile, adjusted gender parity index (GPIA)"
## [34,] "UIS: Net attendance rate, lower secondary, fourth quintile, adjusted gender parity index (GPIA)"
## [35,] "UIS: Net attendance rate, lower secondary, middle quintile, adjusted gender parity index (GPIA)"
## [36,] "UIS: Net attendance rate, lower secondary, second quintile, adjusted gender parity index (GPIA)"
## [37,] "UIS: Net attendance rate, lower secondary, poorest quintile, adjusted gender parity index (GPIA)"
## [38,] "UIS: Net attendance rate, lower secondary, adjusted gender parity index (GPIA)"
## [39,] "UIS: Net attendance rate, primary, urban, adjusted gender parity index (GPIA)"
## [40,] "UIS: Net attendance rate, primary, rural, adjusted gender parity index (GPIA)"
## [41,] "School enrollment, tertiary (gross), gender parity index (GPI)"
## [42,] "School enrollment, secondary (gross), gender parity index (GPI)"
## [43,] "School enrollment, primary and secondary (gross), gender parity index (GPI)"
## [44,] "School enrollment, primary (gross), gender parity index (GPI)"
## [45,] "Literacy rate, youth (ages 15-24), gender parity index (GPI)"
## [46,] "Gross intake ratio to Grade 1 of lower secondary general education, gender parity index (GPI)"
## [47,] "Lower secondary completion rate, gender parity index (GPI)"
## [48,] "Gross intake ratio to Grade 1 of primary education, gender parity index (GPI)"
## [49,] "Primary completion rate, gender parity index (GPI)"
## [50,] "UIS: Adjusted net attendance rate, primary, richest quintile, adjusted gender parity index (GPIA)"
## [51,] "UIS: Adjusted net attendance rate, primary, fourth quintile, adjusted gender parity index (GPIA)"
## [52,] "UIS: Adjusted net attendance rate, primary, middle quintile, adjusted gender parity index (GPIA)"
## [53,] "UIS: Adjusted net attendance rate, primary, second quintile, adjusted gender parity index (GPIA)"
## [54,] "UIS: Adjusted net attendance rate, primary, poorest quintile, adjusted gender parity index (GPIA)"
## [55,] "UIS: Adjusted net attendance rate, primary, adjusted gender parity index (GPIA)"
## [56,] "UIS: Net attendance rate, lower secondary, urban, adjusted gender parity index (GPIA)"
## [57,] "UIS: Net attendance rate, lower secondary, rural, adjusted gender parity index (GPIA)"
## [58,] "Wittgenstein Projection: Mean Years of Schooling. Age 15+. Gender Gap"
## [59,] "Percentage of repeaters in lower secondary education, all grades, gender parity index (GPI)"
## [60,] "Percentage of repeaters in primary education, all grades, gender parity index (GPI)"
## [61,] "Gross graduation ratio from first degree programmes (ISCED 6 and 7) in tertiary education, gender parity index (GPI)"
## [62,] "Gross graduation ratio from lower secondary education, gender parity index (GPI)"
## [63,] "Gross graduation ratio from primary education, gender parity index (GPI)"
## [64,] "Gross enrolment ratio, post-secondary non-tertiary, gender parity index (GPI)"
## [65,] "Gross enrolment ratio, upper secondary, gender parity index (GPI)"
## [66,] "Gross enrolment ratio, lower secondary, gender parity index (GPI)"
## [67,] "Gross enrolment ratio, primary to tertiary, gender parity index (GPI)"
## [68,] "Gross enrolment ratio, primary and lower secondary, gender parity index (GPI)"
## [69,] "Gross enrolment ratio, pre-primary, gender parity index (GPI)"
## [70,] "UIS: Net attendance rate, primary, richest quintile, adjusted gender parity index (GPIA)"
## [71,] "UIS: Net attendance rate, primary, fourth quintile, adjusted gender parity index (GPIA)"
## [72,] "UIS: Net attendance rate, primary, middle quintile, adjusted gender parity index (GPIA)"
## [73,] "UIS: Net attendance rate, primary, second quintile, adjusted gender parity index (GPIA)"
## [74,] "UIS: Net attendance rate, primary, poorest quintile, adjusted gender parity index (GPIA)"
## [75,] "UIS: Net attendance rate, primary, adjusted gender parity index (GPIA)"
## [76,] "Elderly literacy rate, population 65+ years, gender parity index (GPI)"
## [77,] "Literacy rate, population 25-64 years, gender parity index (GPI)"
## [78,] "Adult literacy rate, population 15+ years, gender parity index (GPI)"
## [79,] "CPIA gender equality rating (1=low to 6=high)"
## [80,] "Registering property: Quality of land administration index with Gender (0-30) (DB17-19 methodology) - Score"
## [81,] "Gender parity index for primary completion rate "
## [82,] "Gender parity index for gross intake ratio in grade 1"
## [83,] "Percentage of teachers in post-secondary non-tertiary education who are trained, gender parity index (GPI)"
## [84,] "Percentage of teachers in upper secondary education who are trained, gender parity index (GPI)"
## [85,] "Percentage of teachers in secondary education who are trained, gender parity index (GPI)"
## [86,] "Percentage of teachers in lower secondary education who are trained, gender parity index (GPI)"
## [87,] "Percentage of teachers in primary education who are trained, gender parity index (GPI)"
## [88,] "Percentage of teachers in pre-primary education who are trained, gender parity index (GPI)"
## [89,] "Effective transition rate from primary to lower secondary general education, gender parity index (GPI)"
## [90,] "Survival rate to the last grade of lower secondary general education, gender parity index (GPI)"
## [91,] "Net intake rate to Grade 1 of primary education by under-age entrants (-1 year), gender parity index (GPI)"
## [92,] "Total net enrolment rate, upper secondary, gender parity index (GPI)"
## [93,] "Total net enrolment rate, lower secondary, gender parity index (GPI)"
## [94,] "Total net enrolment rate, primary, gender parity index (GPI)"
## [95,] "Adjusted net enrolment rate, upper secondary, gender parity index (GPI)"
## [96,] "Adjusted net enrolment rate, lower secondary, gender parity index (GPI)"
## [97,] "Adjusted net enrolment rate, primary, gender parity index (GPI)"
## [98,] "Net enrolment rate, secondary, gender parity index (GPI)"
## [99,] "Net enrolment rate, primary, gender parity index (GPI)"
## [100,] "Net enrolment rate, pre-primary, gender parity index (GPI)"
## [101,] "UIS: Total net attendance rate, lower secondary, urban, adjusted gender parity index (GPIA)"
## [102,] "UIS: Total net attendance rate, lower secondary, rural, adjusted gender parity index (GPIA)"
## [103,] "UIS: Percentage of population age 25+ with a doctoral degree or equivalent (ISCED 8). Gender Parity Index"
## [104,] "UIS: Percentage of population age 25+ with at least a completed master's degree or equivalent (ISCED 7 or higher). Gender Parity Index"
## [105,] "UIS: Percentage of population age 25+ with at least a completed bachelor's or equivalent degree (ISCED 6 or higher). Gender Parity Index"
## [106,] "UIS: Percentage of population age 25+ with at least a completed short-cycle tertiary degree (ISCED 5 or higher). Gender Parity Index"
## [107,] "UIS: Percentage of population age 25+ with at least completed post-secondary education (ISCED 4 or higher). Gender Parity Index"
## [108,] "Adjusted net intake rate to Grade 1 of primary education, gender parity index (GPI)"
## [109,] "Net intake rate to Grade 1 of primary education, gender parity index (GPI)"
## [110,] "Net intake rate to Grade 1 of primary education by over-age entrants (+1 year), gender parity index (GPI)"
## [111,] "Percentage of new entrants to Grade 1 of primary education with early childhood education experience, gender parity index (GPI)"
Podemos poner .* para agregar más terminos (esto es una expresión regular)
WDIsearch('gender.*par')
## indicator
## [1,] "UIS.SLE.1.GPI"
## [2,] "UIS.SLE.0.GPI"
## [3,] "UIS.SR.1.GLAST.GPI"
## [4,] "UIS.SR.1.G5.GPI"
## [5,] "UIS.SR.1.G4.GPI"
## [6,] "UIS.SLEN.12.GPI"
## [7,] "UIS.SLE.56.GPI"
## [8,] "UIS.SLE.4.GPI"
## [9,] "UIS.SLE.23.GPI"
## [10,] "UIS.SLE.1t6.GPI"
## [11,] "UIS.SLE.123.GPI"
## [12,] "UIS.NART.2.Q5.GPIA"
## [13,] "UIS.NART.2.Q4.GPIA"
## [14,] "UIS.NART.2.Q3.GPIA"
## [15,] "UIS.NART.2.Q2.GPIA"
## [16,] "UIS.NART.2.Q1.GPIA"
## [17,] "UIS.NART.2.GPIA"
## [18,] "UIS.NARA.1.URB.GPIA"
## [19,] "UIS.NARA.1.RUR.GPIA"
## [20,] "UIS.EA.3T6.AG25T99.GPI"
## [21,] "UIS.EA.2T6.AG25T99.GPI"
## [22,] "UIS.EA.1T6.AG25T99.GPI"
## [23,] "BI.WAG.PREM.PB.MA"
## [24,] "BI.WAG.PREM.PB.FE"
## [25,] "UIS.NAR.2.Q5.GPIA"
## [26,] "UIS.NAR.2.Q4.GPIA"
## [27,] "UIS.NAR.2.Q3.GPIA"
## [28,] "UIS.NAR.2.Q2.GPIA"
## [29,] "UIS.NAR.2.Q1.GPIA"
## [30,] "UIS.NAR.2.GPIA"
## [31,] "UIS.NAR.1.URB.GPIA"
## [32,] "UIS.NAR.1.RUR.GPIA"
## [33,] "SE.ENR.TERT.FM.ZS"
## [34,] "SE.ENR.SECO.FM.ZS"
## [35,] "SE.ENR.PRSC.FM.ZS"
## [36,] "SE.ENR.PRIM.FM.ZS"
## [37,] "SE.ADT.1524.LT.FM.ZS"
## [38,] "UIS.AIR.2.GPV.GPI"
## [39,] "UIS.AIR.2.GPV.GLAST.GPI"
## [40,] "UIS.AIR.1.GPI"
## [41,] "UIS.AIR.1.Glast.GPI"
## [42,] "UIS.NARA.1.Q5.GPIA"
## [43,] "UIS.NARA.1.Q4.GPIA"
## [44,] "UIS.NARA.1.Q3.GPIA"
## [45,] "UIS.NARA.1.Q2.GPIA"
## [46,] "UIS.NARA.1.Q1.GPIA"
## [47,] "UIS.NARA.1.GPIA"
## [48,] "UIS.NAR.2.URB.GPIA"
## [49,] "UIS.NAR.2.RUR.GPIA"
## [50,] "UIS.REPP.2.GPV.GPI"
## [51,] "UIS.REPP.1.GPI"
## [52,] "UIS.GGR.5.A.GPI"
## [53,] "UIS.GGR.2.GPI"
## [54,] "UIS.GGR.1.GPI"
## [55,] "UIS.GER.4.GPI"
## [56,] "UIS.GER.3.GPI"
## [57,] "UIS.GER.2.GPI"
## [58,] "UIS.GER.1t6.GPI"
## [59,] "UIS.GER.12.GPI"
## [60,] "UIS.GER.0.GPI"
## [61,] "UIS.NAR.1.Q5.GPIA"
## [62,] "UIS.NAR.1.Q4.GPIA"
## [63,] "UIS.NAR.1.Q3.GPIA"
## [64,] "UIS.NAR.1.Q2.GPIA"
## [65,] "UIS.NAR.1.Q1.GPIA"
## [66,] "UIS.NAR.1.GPIA"
## [67,] "UIS.LR.AG65.GPI"
## [68,] "UIS.LR.AG25T64.GPI"
## [69,] "UIS.LR.AG15T99.GPI"
## [70,] "2.6_PCR.GPI"
## [71,] "2.3_GIR.GPI"
## [72,] "UIS.TRTP.4.GPI"
## [73,] "UIS.TRTP.3.GPI"
## [74,] "UIS.TRTP.23.GPI"
## [75,] "UIS.TRTP.2.GPI"
## [76,] "UIS.TRTP.1.GPI"
## [77,] "UIS.TRTP.02.GPI"
## [78,] "UIS.TRANRA.23.GPV.GPI"
## [79,] "UIS.SR.2.GPV.GLAST.GPI"
## [80,] "UIS.NIR.1.AGM1.GPI"
## [81,] "UIS.NERT.3.GPI"
## [82,] "UIS.NERT.2.GPI"
## [83,] "UIS.NERT.1.GPI"
## [84,] "UIS.NERA.3.GPI"
## [85,] "UIS.NERA.2.GPI"
## [86,] "UIS.NERA.1.GPI"
## [87,] "UIS.NER.23.GPI"
## [88,] "UIS.NER.1.GPI"
## [89,] "UIS.NER.0.GPI"
## [90,] "UIS.NART.2.URB.GPIA"
## [91,] "UIS.NART.2.RUR.GPIA"
## [92,] "UIS.EA.8.AG25T99.GPI"
## [93,] "UIS.EA.7T8.AG25T99.GPI"
## [94,] "UIS.EA.6T8.AG25T99.GPI"
## [95,] "UIS.EA.5T8.AG25T99.GPI"
## [96,] "UIS.EA.4T6.AG25T99.GPI"
## [97,] "UIS.NIRA.1.GPI"
## [98,] "UIS.NIR.1.GPI"
## [99,] "UIS.NIR.1.AGP1.GPI"
## [100,] "UIS.ECDP.1.GPI"
## name
## [1,] "School life expectancy, primary, gender parity index (GPI)"
## [2,] "School life expectancy, pre-primary, gender parity index (GPI)"
## [3,] "Survival rate to the last grade of primary education, gender parity index (GPI)"
## [4,] "Survival rate to Grade 5 of primary education, gender parity index (GPI)"
## [5,] "Survival rate to Grade 4 of primary education, gender parity index (GPI)"
## [6,] "School life expectancy, primary and lower secondary (excluding repetition), gender parity index (GPI)"
## [7,] "School life expectancy, tertiary, gender parity index (GPI)"
## [8,] "School life expectancy, post-secondary non-tertiary, gender parity index (GPI)"
## [9,] "School life expectancy, secondary, gender parity index (GPI)"
## [10,] "School life expectancy, primary to tertiary, gender parity index (GPI)"
## [11,] "School life expectancy, primary and secondary, gender parity index (GPI)"
## [12,] "UIS: Total net attendance rate, lower secondary, richest quintile, adjusted gender parity index (GPIA)"
## [13,] "UIS: Total net attendance rate, lower secondary, fourth quintile, adjusted gender parity index (GPIA)"
## [14,] "UIS: Total net attendance rate, lower secondary, middle quintile, adjusted gender parity index (GPIA)"
## [15,] "UIS: Total net attendance rate, lower secondary, second quintile, adjusted gender parity index (GPIA)"
## [16,] "UIS: Total net attendance rate, lower secondary, poorest quintile, adjusted gender parity index (GPIA)"
## [17,] "UIS: Total net attendance rate, lower secondary, adjusted gender parity index (GPIA)"
## [18,] "UIS: Adjusted net attendance rate, primary, urban, adjusted gender parity index (GPIA)"
## [19,] "UIS: Adjusted net attendance rate, primary, rural, adjusted gender parity index (GPIA)"
## [20,] "UIS: Percentage of population age 25+ with at least completed upper secondary education (ISCED 3 or higher). Gender Parity Index"
## [21,] "UIS: Percentage of population age 25+ with at least completed lower secondary education (ISCED 2 or higher). Gender Parity Index"
## [22,] "UIS: Percentage of population age 25+ with at least completed primary education (ISCED 1 or higher). Gender Parity Index"
## [23,] "Public sector wage premiums by gender (Male) (compared to all private employees) (%)"
## [24,] "Public sector wage premiums by gender (Female) (compared to all private employees) (%)"
## [25,] "UIS: Net attendance rate, lower secondary, richest quintile, adjusted gender parity index (GPIA)"
## [26,] "UIS: Net attendance rate, lower secondary, fourth quintile, adjusted gender parity index (GPIA)"
## [27,] "UIS: Net attendance rate, lower secondary, middle quintile, adjusted gender parity index (GPIA)"
## [28,] "UIS: Net attendance rate, lower secondary, second quintile, adjusted gender parity index (GPIA)"
## [29,] "UIS: Net attendance rate, lower secondary, poorest quintile, adjusted gender parity index (GPIA)"
## [30,] "UIS: Net attendance rate, lower secondary, adjusted gender parity index (GPIA)"
## [31,] "UIS: Net attendance rate, primary, urban, adjusted gender parity index (GPIA)"
## [32,] "UIS: Net attendance rate, primary, rural, adjusted gender parity index (GPIA)"
## [33,] "School enrollment, tertiary (gross), gender parity index (GPI)"
## [34,] "School enrollment, secondary (gross), gender parity index (GPI)"
## [35,] "School enrollment, primary and secondary (gross), gender parity index (GPI)"
## [36,] "School enrollment, primary (gross), gender parity index (GPI)"
## [37,] "Literacy rate, youth (ages 15-24), gender parity index (GPI)"
## [38,] "Gross intake ratio to Grade 1 of lower secondary general education, gender parity index (GPI)"
## [39,] "Lower secondary completion rate, gender parity index (GPI)"
## [40,] "Gross intake ratio to Grade 1 of primary education, gender parity index (GPI)"
## [41,] "Primary completion rate, gender parity index (GPI)"
## [42,] "UIS: Adjusted net attendance rate, primary, richest quintile, adjusted gender parity index (GPIA)"
## [43,] "UIS: Adjusted net attendance rate, primary, fourth quintile, adjusted gender parity index (GPIA)"
## [44,] "UIS: Adjusted net attendance rate, primary, middle quintile, adjusted gender parity index (GPIA)"
## [45,] "UIS: Adjusted net attendance rate, primary, second quintile, adjusted gender parity index (GPIA)"
## [46,] "UIS: Adjusted net attendance rate, primary, poorest quintile, adjusted gender parity index (GPIA)"
## [47,] "UIS: Adjusted net attendance rate, primary, adjusted gender parity index (GPIA)"
## [48,] "UIS: Net attendance rate, lower secondary, urban, adjusted gender parity index (GPIA)"
## [49,] "UIS: Net attendance rate, lower secondary, rural, adjusted gender parity index (GPIA)"
## [50,] "Percentage of repeaters in lower secondary education, all grades, gender parity index (GPI)"
## [51,] "Percentage of repeaters in primary education, all grades, gender parity index (GPI)"
## [52,] "Gross graduation ratio from first degree programmes (ISCED 6 and 7) in tertiary education, gender parity index (GPI)"
## [53,] "Gross graduation ratio from lower secondary education, gender parity index (GPI)"
## [54,] "Gross graduation ratio from primary education, gender parity index (GPI)"
## [55,] "Gross enrolment ratio, post-secondary non-tertiary, gender parity index (GPI)"
## [56,] "Gross enrolment ratio, upper secondary, gender parity index (GPI)"
## [57,] "Gross enrolment ratio, lower secondary, gender parity index (GPI)"
## [58,] "Gross enrolment ratio, primary to tertiary, gender parity index (GPI)"
## [59,] "Gross enrolment ratio, primary and lower secondary, gender parity index (GPI)"
## [60,] "Gross enrolment ratio, pre-primary, gender parity index (GPI)"
## [61,] "UIS: Net attendance rate, primary, richest quintile, adjusted gender parity index (GPIA)"
## [62,] "UIS: Net attendance rate, primary, fourth quintile, adjusted gender parity index (GPIA)"
## [63,] "UIS: Net attendance rate, primary, middle quintile, adjusted gender parity index (GPIA)"
## [64,] "UIS: Net attendance rate, primary, second quintile, adjusted gender parity index (GPIA)"
## [65,] "UIS: Net attendance rate, primary, poorest quintile, adjusted gender parity index (GPIA)"
## [66,] "UIS: Net attendance rate, primary, adjusted gender parity index (GPIA)"
## [67,] "Elderly literacy rate, population 65+ years, gender parity index (GPI)"
## [68,] "Literacy rate, population 25-64 years, gender parity index (GPI)"
## [69,] "Adult literacy rate, population 15+ years, gender parity index (GPI)"
## [70,] "Gender parity index for primary completion rate "
## [71,] "Gender parity index for gross intake ratio in grade 1"
## [72,] "Percentage of teachers in post-secondary non-tertiary education who are trained, gender parity index (GPI)"
## [73,] "Percentage of teachers in upper secondary education who are trained, gender parity index (GPI)"
## [74,] "Percentage of teachers in secondary education who are trained, gender parity index (GPI)"
## [75,] "Percentage of teachers in lower secondary education who are trained, gender parity index (GPI)"
## [76,] "Percentage of teachers in primary education who are trained, gender parity index (GPI)"
## [77,] "Percentage of teachers in pre-primary education who are trained, gender parity index (GPI)"
## [78,] "Effective transition rate from primary to lower secondary general education, gender parity index (GPI)"
## [79,] "Survival rate to the last grade of lower secondary general education, gender parity index (GPI)"
## [80,] "Net intake rate to Grade 1 of primary education by under-age entrants (-1 year), gender parity index (GPI)"
## [81,] "Total net enrolment rate, upper secondary, gender parity index (GPI)"
## [82,] "Total net enrolment rate, lower secondary, gender parity index (GPI)"
## [83,] "Total net enrolment rate, primary, gender parity index (GPI)"
## [84,] "Adjusted net enrolment rate, upper secondary, gender parity index (GPI)"
## [85,] "Adjusted net enrolment rate, lower secondary, gender parity index (GPI)"
## [86,] "Adjusted net enrolment rate, primary, gender parity index (GPI)"
## [87,] "Net enrolment rate, secondary, gender parity index (GPI)"
## [88,] "Net enrolment rate, primary, gender parity index (GPI)"
## [89,] "Net enrolment rate, pre-primary, gender parity index (GPI)"
## [90,] "UIS: Total net attendance rate, lower secondary, urban, adjusted gender parity index (GPIA)"
## [91,] "UIS: Total net attendance rate, lower secondary, rural, adjusted gender parity index (GPIA)"
## [92,] "UIS: Percentage of population age 25+ with a doctoral degree or equivalent (ISCED 8). Gender Parity Index"
## [93,] "UIS: Percentage of population age 25+ with at least a completed master's degree or equivalent (ISCED 7 or higher). Gender Parity Index"
## [94,] "UIS: Percentage of population age 25+ with at least a completed bachelor's or equivalent degree (ISCED 6 or higher). Gender Parity Index"
## [95,] "UIS: Percentage of population age 25+ with at least a completed short-cycle tertiary degree (ISCED 5 or higher). Gender Parity Index"
## [96,] "UIS: Percentage of population age 25+ with at least completed post-secondary education (ISCED 4 or higher). Gender Parity Index"
## [97,] "Adjusted net intake rate to Grade 1 of primary education, gender parity index (GPI)"
## [98,] "Net intake rate to Grade 1 of primary education, gender parity index (GPI)"
## [99,] "Net intake rate to Grade 1 of primary education by over-age entrants (+1 year), gender parity index (GPI)"
## [100,] "Percentage of new entrants to Grade 1 of primary education with early childhood education experience, gender parity index (GPI)"
Una vez tenemos el nombre del indicador podemos hacer una consulta
consulta <- WDI(indicator='PRJ.MYS.25UP.GPI', country = 'SV', start=1960, end=2015)
head(consulta)
## iso2c country PRJ.MYS.25UP.GPI year
## 1 SV El Salvador 0.61 2015
## 2 SV El Salvador NA 2014
## 3 SV El Salvador NA 2013
## 4 SV El Salvador NA 2012
## 5 SV El Salvador NA 2011
## 6 SV El Salvador 0.66 2010
Más información del paquete: https://www.r-project.org/nosvn/pandoc/WDI.html
Haga una consulta del GDP pc de El Salvador [indicator=“NY.GDP.PCAP.KD”]. ¿Desde cuándo está disponible la información? ¿Hasta cuándo? Establezca el vector de “time-series” Grafique la serie y también grafique la serie con a una diferencia. Envíe el código y la gráfica (revise como la puede exportar) a la siguiente liga https://tinyurl.com/Ej4-ESA-R