Instalamos el paquete de banxico
#install.packages("siebanxicor")
library("siebanxicor")
## Warning: package 'siebanxicor' was built under R version 4.3.3
Token
setToken("0959cb4364c0e0885a8479476baaf158f6195c1de0613aaa98b1e06afd8ae5a0")
Extraemos la serie de datos para Tasas de desocupación abierta en áreas urbanas Total Porcentaje con respecto a la PEA, de https://www.banxico.org.mx/SieAPIRest/service/v1/doc/catalogoSeries#
idSeries="SL1"
series=getSeriesData(idSeries,"1990-01-01","2024-08-01")
Desocupacion=getSerieDataFrame(series,"SL1")
tail(Desocupacion,30)
## date value
## 159 2003-03-01 2.82
## 160 2003-04-01 2.95
## 161 2003-05-01 2.74
## 162 2003-06-01 3.27
## 163 2003-07-01 3.52
## 164 2003-08-01 3.96
## 165 2003-09-01 3.87
## 166 2003-10-01 3.63
## 167 2003-11-01 3.80
## 168 2003-12-01 2.96
## 169 2004-01-01 3.81
## 170 2004-02-01 3.92
## 171 2004-03-01 3.86
## 172 2004-04-01 3.58
## 173 2004-05-01 3.48
## 174 2004-06-01 3.78
## 175 2004-07-01 3.75
## 176 2004-08-01 4.35
## 177 2004-09-01 4.01
## 178 2004-10-01 3.60
## 179 2004-11-01 3.78
## 180 2004-12-01 3.04
## 181 2005-01-01 3.75
## 182 2005-02-01 3.93
## 183 2005-03-01 3.95
## 184 2005-04-01 4.20
## 185 2005-05-01 4.29
## 186 2005-06-01 3.54
## 187 2005-07-01 3.50
## 188 2005-08-01 4.05
Graficamos la serie
#install.packages("ggplot2")
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.3.3
ggplot(Desocupacion,aes(x=date,y=value))+geom_line(color="pink",size=0.8)+theme_light()+ggtitle("Tasa de Desocupación respecto a la PEA")+ylab("Nivel")+xlab("Fecha")+labs(caption="Fuente: BANXICO",subtitle = "En porcentaje (%)")
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.