library(readxl)
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
library(readr)
library(kableExtra)
## 
## Attaching package: 'kableExtra'
## The following object is masked from 'package:dplyr':
## 
##     group_rows
options(scipen=99999999)
library(readxl)
PIB_Colombia <- read_excel("C:/Users/Arturo/Desktop/PIB_Colombia.xlsx")
library(mFilter)
## Warning: package 'mFilter' was built under R version 4.0.4
lambda_HP <-100
Colombia_HP <- hpfilter(PIB_Colombia, type = "lambda", freq = lambda_HP)
plot(Colombia_HP, ask = FALSE)
abline(h=0, col="blue")

PIB_potencial<- (Colombia_HP$trend)
Comparacion <- cbind(PIB_Colombia,PIB_potencial)
tabla1 <- data.frame("anios"=1990:2019, Comparacion)
tabla12 <- rename(tabla1, "PIB_REAL"="PIB", "PIB_POTENCIAL"="PIB.1", "Años"="anios")
tabla12 %>%kbl() %>% kable_material_dark()
Años PIB_REAL PIB_POTENCIAL
1990 147882238078 149350940897
1991 150842260190 154698859335
1992 156943723177 160032090744
1993 165395786043 165297382107
1994 175012991811 170410596725
1995 184117933489 175288581945
1996 187903130700 179894209061
1997 194348759914 184278642883
1998 195456128227 188573137438
1999 187239122802 193009647923
2000 192715607786 197888959443
2001 195949179708 203454151851
2002 200855708890 209896571486
2003 208725781698 217332514961
2004 219857173696 225787870269
2005 230473551393 235202458064
2006 245954157224 245456792040
2007 262527027189 256384096820
2008 271146960851 267822570681
2009 274237083517 279671841204
2010 286563105192 291864779870
2011 306473200201 304279910584
2012 318464380249 316742740505
2013 334814320894 329100709686
2014 349877717639 341218474580
2015 360219757906 353017827752
2016 367738922100 364507154194
2017 372737821103 375766858204
2018 382113386673 386909661757
2019 394571111125 398017996456