Skip to content

Instantly share code, notes, and snippets.

@sicarul
Created April 8, 2019 02:47
Show Gist options
  • Save sicarul/a27a6bcfe52c4ff4db71e86e7d187ce5 to your computer and use it in GitHub Desktop.
Save sicarul/a27a6bcfe52c4ff4db71e86e7d187ce5 to your computer and use it in GitHub Desktop.
Importaciones sobre PBI Argentina - 1980 a 2017
Uso 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018
Total general 10,540,603 9,430,226 5,336,914 4,504,156 4,584,672 3,814,148 4,724,053 5,817,818 5,321,565 4,203,194 4,076,665 8,275,271 14,871,754 16,783,513 21,590,255 20,121,682 23,761,809 30,450,184 31,377,360 25,508,157 25,280,485 20,319,579 8,989,546 13,850,774 22,445,281 28,686,890 34,153,682 44,707,463 57,462,452 38,786,269 56,792,578 73,960,676 67,974,215 74,441,800 65,736,069 60,203,036 55,852,065 66,929,695 65,441,026
Bienes de capital 2,323,135 2,096,871 982,261 786,745 691,948 701,547 663,363 1,041,032 904,360 744,968 635,572 1,435,027 3,089,685 4,112,144 6,006,195 4,745,635 5,606,863 7,717,934 8,499,893 6,748,017 5,924,233 4,180,782 1,292,766 2,494,779 5,331,098 7,010,549 8,201,408 10,396,575 12,668,131 8,657,736 11,647,003 13,610,799 11,788,099 11,772,646 11,977,305 12,033,659 12,122,486 14,907,036 12,233,129
Bienes intermedios 3,600,969 3,026,878 2,332,888 2,269,772 2,328,384 1,697,753 2,361,966 2,532,155 2,581,422 2,157,841 2,069,108 3,419,183 4,745,576 5,062,519 6,242,230 7,219,950 8,407,640 10,094,610 10,017,704 8,353,922 8,442,636 7,342,938 4,368,516 6,266,911 8,632,239 10,375,839 11,917,465 15,370,779 20,225,910 12,560,797 17,687,386 21,793,323 19,821,456 19,514,391 18,765,763 18,104,079 15,482,866 17,837,183 20,442,561
Combustibles y lubricantes 985,114 861,911 643,904 451,516 471,267 455,883 418,507 658,835 494,539 365,457 321,955 452,057 415,808 386,701 606,360 809,472 844,654 970,214 852,873 730,204 1,034,845 841,233 482,222 549,806 1,003,321 1,545,391 1,732,151 2,844,592 4,333,257 2,626,191 4,765,218 9,796,201 9,128,335 12,464,062 11,343,249 6,854,057 4,855,663 5,722,674 6,528,864
Piezas y accesorios para bienes de capital 1,254,971 1,395,222 888,707 746,907 810,207 718,452 920,249 1,217,068 1,052,654 700,481 690,947 1,236,583 2,596,578 2,811,638 3,400,561 3,373,217 4,108,140 5,541,024 5,521,410 4,197,254 4,448,578 3,406,668 1,525,496 2,261,909 3,622,297 4,858,286 6,175,370 8,065,132 9,958,627 7,229,579 11,458,714 14,919,218 14,395,841 15,958,483 13,141,906 12,761,491 11,307,583 12,922,192 12,164,292
Bienes de consumo 2,054,789 1,661,137 442,605 244,115 282,156 237,540 346,388 346,705 272,013 220,822 330,344 1,514,164 3,204,808 3,526,585 3,906,512 3,173,777 3,582,995 4,535,786 4,833,587 4,501,017 4,608,664 3,997,814 1,137,237 1,755,488 2,501,236 3,162,168 3,969,656 5,207,515 6,292,075 5,068,708 6,610,896 8,039,838 7,179,003 7,439,833 6,684,867 6,820,002 7,399,131 8,945,213 8,485,041
Vehículos automotores de pasajeros 239,377 243,946 27,039 4,191 113 2,433 10,720 16,926 12,335 6,576 11,738 202,206 792,881 849,129 1,398,813 774,814 1,199,348 1,564,017 1,627,909 956,606 798,873 534,966 173,709 508,847 1,196,758 1,602,536 2,038,151 2,708,533 3,873,632 2,512,243 4,481,673 5,592,171 5,358,504 7,063,075 3,573,819 3,353,384 4,468,468 6,296,705 5,274,480
Resto 82,248 144,261 19,509 909 596 541 2,860 5,098 4,241 7,049 17,001 16,051 26,418 34,797 29,585 24,817 12,170 26,599 23,984 21,138 22,656 15,178 9,600 13,034 158,332 132,121 119,481 114,338 110,820 131,015 141,688 209,126 302,977 229,310 249,161 276,364 215,870 298,692 312,660
library(tidyverse)
library(ggplot2)
# Fuente: https://www.indec.gob.ar/bajarCuadroEstadistico.asp?idc=2EDA403F02C233A1B46A148394F2F5F71E0DB8DCC4501DEBE022A3C1D226244BA5A822D58E3F32B1
importaciones = read_csv('importaciones.csv')
importaciones_cat = gather(importaciones, `Año`, Dolares, -Uso) %>%
mutate(Dolares=Dolares*1000, `Año`=as.integer(`Año`))
#Fuente: https://data.worldbank.org/indicator/NY.GDP.MKTP.CN?locations=AR
pbi = tribble(
~pbi,
76961923742, 78676842366, 84307486837, 1.03979E+11, 79092001998, 88416668900, 1.10934E+11, 1.11106E+11, 1.26207E+11, 76636898036, 1.41352E+11, 1.8972E+11, 2.28789E+11, 2.36742E+11, 2.5744E+11, 2.58032E+11, 2.7215E+11, 2.92859E+11, 2.98948E+11, 2.83523E+11, 2.84204E+11, 2.68697E+11, 97724004252, 1.27587E+11, 1.64658E+11, 1.98737E+11, 2.32557E+11, 2.87531E+11, 3.61558E+11, 3.32976E+11, 4.23627E+11, 5.30163E+11, 5.45982E+11, 5.52025E+11, 5.2632E+11, 5.94749E+11, 5.54861E+11, 6.3743E+11
) %>% mutate(
`Año`=1980:2017
)
importaciones_pbi = inner_join(importaciones_cat, pbi, by='Año') %>%
mutate(sobre_pbi=Dolares/pbi) %>% filter(Uso != 'Total general')
ggplot(importaciones_pbi, aes(x=`Año`, y=sobre_pbi, fill=Uso)) +
geom_bar(stat='identity') +
scale_x_continuous(breaks=seq(1980,2017,2)) +
scale_y_continuous(labels = scales::percent) +
ylab('Porcentaje de importaciones sobre el PBI') +
theme_light() +
theme(axis.text.x = element_text(angle = 90, hjust = 1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment