Librerias
library(readxl)
library(writexl)
library(ggplot2)
Cargar datos
datos1=read_excel("Oferta.xlsx", sheet = 2)
head(datos1,3)
## # A tibble: 3 × 1
## OFERTA
## <dbl>
## 1 17560884.
## 2 18110589.
## 3 19138105.
Gráfico
d1s=ts(datos1,start = 1988,frequency = 1)
plot(d1s)

Pronóstico
d1sw=HoltWinters(d1s,gamma = F)
d1sp=predict(d1sw,10)
d1sp
## Time Series:
## Start = 2025
## End = 2034
## Frequency = 1
## fit
## [1,] 64211908
## [2,] 65351584
## [3,] 66491260
## [4,] 67630936
## [5,] 68770612
## [6,] 69910288
## [7,] 71049964
## [8,] 72189640
## [9,] 73329316
## [10,] 74468992
plot(d1sw,d1sp,main="OFERTA FINAL : 1988 : 2024")

Guardar datos
Periodo=seq(1988,2034,1)
Oferta=rbind(d1s,d1sp)
Dato=c(rep("Real",37),rep("Pronosticado",10))
Datos_Oferta=data.frame(Periodo,Oferta,Dato)
Ggplot2
ggplot(Datos_Oferta,
aes(x=Periodo,y=OFERTA,col=Dato))+
geom_line()+
geom_point()+
theme_bw()
