Exploración producción de caucho

Exploración EVAS y FAO: Caucho

Author

Estefani Cárdenas Ramírez

Biblliotecas

library(readr)
library(dplyr)

Adjuntando el paquete: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
library(ggplot2)
library(janitor)

Adjuntando el paquete: 'janitor'
The following objects are masked from 'package:stats':

    chisq.test, fisher.test
library(patchwork)

Evaluaciones Agropecuarias Municipales y Registros de la FAO, relacionados con el Cultivo de Caucho

  • Fuente: Datos Abiertos de Colombia

Evas 2007-2108: https://www.datos.gov.co/Agricultura-y-Desarrollo-Rural/Evaluaciones-Agropecuarias-Municipales-EVA/2pnw-mmge/about_data

Evas 2018 - 2022: https://www.datos.gov.co/Agricultura-y-Desarrollo-Rural/Evaluaciones-Agropecuarias-Municipales-EVA-2019-20/uejq-wxrr/about_data

Evas 2007-2018

caucho_eva1 <- read_csv("datos_caucho/datos_colombia/Evaluaciones_Agropecuarias_Municipales_EVA_20240914.csv") 
Rows: 206068 Columns: 17
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (10): DEPARTAMENTO, MUNICIPIO, GRUPO 
DE CULTIVO, SUBGRUPO 
DE CULTIVO, ...
dbl  (7): CÓD. 
DEP., CÓD. MUN., AÑO, Área Sembrada
(ha), Área Cosechada
(ha...

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
caucho_eva1 %>% 
  head()
# A tibble: 6 × 17
  `CÓD. \nDEP.` DEPARTAMENTO       `CÓD. MUN.` MUNICIPIO  `GRUPO \nDE CULTIVO`
          <dbl> <chr>                    <dbl> <chr>      <chr>               
1            15 BOYACA                   15114 BUSBANZA   HORTALIZAS          
2            25 CUNDINAMARCA             25754 SOACHA     HORTALIZAS          
3            25 CUNDINAMARCA             25214 COTA       HORTALIZAS          
4            54 NORTE DE SANTANDER       54405 LOS PATIOS HORTALIZAS          
5            54 NORTE DE SANTANDER       54518 PAMPLONA   HORTALIZAS          
6            68 SANTANDER                68377 LA BELLEZA HORTALIZAS          
# ℹ 12 more variables: `SUBGRUPO \nDE CULTIVO` <chr>, CULTIVO <chr>,
#   `DESAGREGACIÓN REGIONAL Y/O SISTEMA PRODUCTIVO` <chr>, AÑO <dbl>,
#   PERIODO <chr>, `Área Sembrada\n(ha)` <dbl>, `Área Cosechada\n(ha)` <dbl>,
#   `Producción\n(t)` <dbl>, `Rendimiento\n(t/ha)` <dbl>,
#   `ESTADO FISICO PRODUCCION` <chr>, `NOMBRE \nCIENTIFICO` <chr>,
#   `CICLO DE CULTIVO` <chr>

Evas 2018-2022

caucho_eva2 <- read_csv("datos_caucho/datos_colombia/Evaluaciones_Agropecuarias_Municipales___EVA._2019_-_2023._Base_Agr_cola_20240914.csv") 
Rows: 115572 Columns: 18
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (12): Código Dane departamento, Departamento, Código Dane municipio, Mun...
dbl  (3): Año, Rendimiento, Código del cultivo
num  (3): Área sembrada, Área cosechada, Producción

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
caucho_eva2 %>% 
  head()
# A tibble: 6 × 18
  `Código Dane departamento` Departamento `Código Dane municipio` Municipio
  <chr>                      <chr>        <chr>                   <chr>    
1 05                         Antioquia    05002                   Abejorral
2 05                         Antioquia    05002                   Abejorral
3 05                         Antioquia    05002                   Abejorral
4 05                         Antioquia    05002                   Abejorral
5 05                         Antioquia    05002                   Abejorral
6 05                         Antioquia    05002                   Abejorral
# ℹ 14 more variables: `Grupo cultivo` <chr>, Subgrupo <chr>, Cultivo <chr>,
#   `Desagregación cultivo` <chr>, Año <dbl>, Periodo <chr>,
#   `Área sembrada` <dbl>, `Área cosechada` <dbl>, Producción <dbl>,
#   Rendimiento <dbl>, `Ciclo del cultivo` <chr>,
#   `Estado físico del cultivo` <chr>, `Código del cultivo` <dbl>,
#   `Nombre científico del cultivo` <chr>

Depuración datos1

Estructura Eva1

glimpse(caucho_eva1)
Rows: 206,068
Columns: 17
$ `CÓD. \nDEP.`                                   <dbl> 15, 25, 25, 54, 54, 68…
$ DEPARTAMENTO                                    <chr> "BOYACA", "CUNDINAMARC…
$ `CÓD. MUN.`                                     <dbl> 15114, 25754, 25214, 5…
$ MUNICIPIO                                       <chr> "BUSBANZA", "SOACHA", …
$ `GRUPO \nDE CULTIVO`                            <chr> "HORTALIZAS", "HORTALI…
$ `SUBGRUPO \nDE CULTIVO`                         <chr> "ACELGA", "ACELGA", "A…
$ CULTIVO                                         <chr> "ACELGA", "ACELGA", "A…
$ `DESAGREGACIÓN REGIONAL Y/O SISTEMA PRODUCTIVO` <chr> "ACELGA", "ACELGA", "A…
$ AÑO                                             <dbl> 2006, 2006, 2006, 2006…
$ PERIODO                                         <chr> "2006B", "2006B", "200…
$ `Área Sembrada\n(ha)`                           <dbl> 2, 82, 2, 3, 1, 1, 72,…
$ `Área Cosechada\n(ha)`                          <dbl> 1, 80, 2, 3, 1, 1, 70,…
$ `Producción\n(t)`                               <dbl> 1, 1440, 26, 48, 5, 6,…
$ `Rendimiento\n(t/ha)`                           <dbl> 1.00, 18.00, 17.33, 16…
$ `ESTADO FISICO PRODUCCION`                      <chr> "FRUTO FRESCO", "FRUTO…
$ `NOMBRE \nCIENTIFICO`                           <chr> "BETA VULGARIS", "BETA…
$ `CICLO DE CULTIVO`                              <chr> "TRANSITORIO", "TRANSI…
  1. 206,068 filas x 17 columnas
  2. Interesada en las varibles de codigo de departamento, departamento, codigo de municipio, municipio, cultivo, año, area sembrada, area cosechada, producciin y rendimeinto
  3. El tipo de datos corresponde a la naturaleza de las variables
  4. Los nombres de las variables se deben pasar a minusculas y quitar espacios

Resumen General EVa1

summary(caucho_eva1)
   CÓD. \nDEP.   DEPARTAMENTO         CÓD. MUN.      MUNICIPIO        
 Min.   : 5.00   Length:206068      Min.   : 5001   Length:206068     
 1st Qu.:17.00   Class :character   1st Qu.:17524   Class :character  
 Median :41.00   Mode  :character   Median :41357   Mode  :character  
 Mean   :40.32                      Mean   :40748                     
 3rd Qu.:68.00                      3rd Qu.:68001                     
 Max.   :99.00                      Max.   :99773                     
                                                                      
 GRUPO \nDE CULTIVO SUBGRUPO \nDE CULTIVO   CULTIVO         
 Length:206068      Length:206068         Length:206068     
 Class :character   Class :character      Class :character  
 Mode  :character   Mode  :character      Mode  :character  
                                                            
                                                            
                                                            
                                                            
 DESAGREGACIÓN REGIONAL Y/O SISTEMA PRODUCTIVO      AÑO      
 Length:206068                                 Min.   :2006  
 Class :character                              1st Qu.:2009  
 Mode  :character                              Median :2013  
                                               Mean   :2012  
                                               3rd Qu.:2015  
                                               Max.   :2018  
                                                             
   PERIODO          Área Sembrada\n(ha) Área Cosechada\n(ha) Producción\n(t)  
 Length:206068      Min.   :    0.0     Min.   :    0.0      Min.   :      0  
 Class :character   1st Qu.:   10.0     1st Qu.:    8.0      1st Qu.:     32  
 Mode  :character   Median :   35.0     Median :   30.0      Median :    140  
                    Mean   :  291.1     Mean   :  249.4      Mean   :   2791  
                    3rd Qu.:  151.0     3rd Qu.:  130.0      3rd Qu.:    648  
                    Max.   :47403.0     Max.   :38600.0      Max.   :4546116  
                                                                              
 Rendimiento\n(t/ha) ESTADO FISICO PRODUCCION NOMBRE \nCIENTIFICO
 Min.   :  0.030     Length:206068            Length:206068      
 1st Qu.:  1.500     Class :character         Class :character   
 Median :  5.000     Mode  :character         Mode  :character   
 Mean   :  9.239                                                 
 3rd Qu.: 11.230                                                 
 Max.   :246.000                                                 
 NA's   :3433                                                    
 CICLO DE CULTIVO  
 Length:206068     
 Class :character  
 Mode  :character  
                   
                   
                   
                   

NO se observan entradas en blanco o NA

Limpieza de variables

caucho_eva1l <- caucho_eva1 %>% 
  clean_names()
caucho_eva1l
# A tibble: 206,068 × 17
   cod_dep departamento   cod_mun municipio grupo_de_cultivo subgrupo_de_cultivo
     <dbl> <chr>            <dbl> <chr>     <chr>            <chr>              
 1      15 BOYACA           15114 BUSBANZA  HORTALIZAS       ACELGA             
 2      25 CUNDINAMARCA     25754 SOACHA    HORTALIZAS       ACELGA             
 3      25 CUNDINAMARCA     25214 COTA      HORTALIZAS       ACELGA             
 4      54 NORTE DE SANT…   54405 LOS PATI… HORTALIZAS       ACELGA             
 5      54 NORTE DE SANT…   54518 PAMPLONA  HORTALIZAS       ACELGA             
 6      68 SANTANDER        68377 LA BELLE… HORTALIZAS       ACELGA             
 7      25 CUNDINAMARCA     25754 SOACHA    HORTALIZAS       ACELGA             
 8      25 CUNDINAMARCA     25214 COTA      HORTALIZAS       ACELGA             
 9      54 NORTE DE SANT…   54518 PAMPLONA  HORTALIZAS       ACELGA             
10      68 SANTANDER        68377 LA BELLE… HORTALIZAS       ACELGA             
# ℹ 206,058 more rows
# ℹ 11 more variables: cultivo <chr>,
#   desagregacion_regional_y_o_sistema_productivo <chr>, ano <dbl>,
#   periodo <chr>, area_sembrada_ha <dbl>, area_cosechada_ha <dbl>,
#   produccion_t <dbl>, rendimiento_t_ha <dbl>, estado_fisico_produccion <chr>,
#   nombre_cientifico <chr>, ciclo_de_cultivo <chr>

Corroboramos limpieza

names(caucho_eva1l)
 [1] "cod_dep"                                      
 [2] "departamento"                                 
 [3] "cod_mun"                                      
 [4] "municipio"                                    
 [5] "grupo_de_cultivo"                             
 [6] "subgrupo_de_cultivo"                          
 [7] "cultivo"                                      
 [8] "desagregacion_regional_y_o_sistema_productivo"
 [9] "ano"                                          
[10] "periodo"                                      
[11] "area_sembrada_ha"                             
[12] "area_cosechada_ha"                            
[13] "produccion_t"                                 
[14] "rendimiento_t_ha"                             
[15] "estado_fisico_produccion"                     
[16] "nombre_cientifico"                            
[17] "ciclo_de_cultivo"                             

Seleccionamos variables de interés

datos_caucho1 <- caucho_eva1l %>% 
  select(-grupo_de_cultivo ,-subgrupo_de_cultivo, -desagregacion_regional_y_o_sistema_productivo,- periodo,-estado_fisico_produccion, -nombre_cientifico, -ciclo_de_cultivo) %>% 
  rename(
    year = ano
  )
datos_caucho1 
# A tibble: 206,068 × 10
   cod_dep departamento       cod_mun municipio  cultivo  year area_sembrada_ha
     <dbl> <chr>                <dbl> <chr>      <chr>   <dbl>            <dbl>
 1      15 BOYACA               15114 BUSBANZA   ACELGA   2006                2
 2      25 CUNDINAMARCA         25754 SOACHA     ACELGA   2006               82
 3      25 CUNDINAMARCA         25214 COTA       ACELGA   2006                2
 4      54 NORTE DE SANTANDER   54405 LOS PATIOS ACELGA   2006                3
 5      54 NORTE DE SANTANDER   54518 PAMPLONA   ACELGA   2006                1
 6      68 SANTANDER            68377 LA BELLEZA ACELGA   2006                1
 7      25 CUNDINAMARCA         25754 SOACHA     ACELGA   2007               72
 8      25 CUNDINAMARCA         25214 COTA       ACELGA   2007                2
 9      54 NORTE DE SANTANDER   54518 PAMPLONA   ACELGA   2007                1
10      68 SANTANDER            68377 LA BELLEZA ACELGA   2007                1
# ℹ 206,058 more rows
# ℹ 3 more variables: area_cosechada_ha <dbl>, produccion_t <dbl>,
#   rendimiento_t_ha <dbl>

agrupar por el cultivo de interés = Caucho

unique(datos_caucho1$cultivo)
  [1] "ACELGA"                           "ACHICORIA"                       
  [3] "MALANGA"                          "ACHIRA"                          
  [5] "ACHIOTE"                          "AGRAZ"                           
  [7] "AGUACATE"                         "AJI"                             
  [9] "AGUAJE"                           "AHUYAMA"                         
 [11] "AJO"                              "AJONJOLI"                        
 [13] "ALBAHACA"                         "ALFALFA"                         
 [15] "ALCACHOFA"                        "ALGARROBO"                       
 [17] "ALGODON"                          "AMARANTO"                        
 [19] "ANIS"                             "ANON"                            
 [21] "ANTURIO"                          "APIO"                            
 [23] "ARANDANO"                         "ARAZA"                           
 [25] "ARRACACHA"                        "ARROZ"                           
 [27] "ARVEJA"                           "ASAI"                            
 [29] "ASPARRAGUS"                       "ASTROMELIA"                      
 [31] "AVENA"                            "BACURI"                          
 [33] "BADEA"                            "BANANITO"                        
 [35] "BANANO"                           "BATATA"                          
 [37] "BERENJENA"                        "BREVO"                           
 [39] "BORE"                             "BOROJO"                          
 [41] "BROCOLI"                          "CACAO"                           
 [43] "PLATANO"                          "CADUCIFOLIOS"                    
 [45] "CAFE"                             "CAUCHO"                          
 [47] "CAIMO"                            "CALABACIN"                       
 [49] "CALABAZA"                         "CALENDULA"                       
 [51] "CANYARANA"                        "CAÑA AZUCARERA"                  
 [53] "CAÑA FLECHA"                      "CAÑA MIEL"                       
 [55] "CAÑA PANELERA"                    "CARDAMOMO"                       
 [57] "CEBADA"                           "CEBOLLA DE BULBO"                
 [59] "CENTENO"                          "CEBOLLA DE RAMA"                 
 [61] "CEBOLLIN"                         "CHACHAFRUTO"                     
 [63] "CHAMBA"                           "CHAMPIÑON"                       
 [65] "CHIA"                             "CIMARRON"                        
 [67] "CHIRIMOYA"                        "CHOLUPA"                         
 [69] "CIRUELA"                          "CHONQUE"                         
 [71] "CHONTADURO"                       "CITRICOS"                        
 [73] "CILANTRO"                         "CLAVEL"                          
 [75] "COCCULUS"                         "COCO"                            
 [77] "COCONA"                           "COL"                             
 [79] "CURUBA"                           "COLIFLOR"                        
 [81] "COPOAZU"                          "CORDELINE CINTA"                 
 [83] "COROZO"                           "CURCUMA"                         
 [85] "DATIL"                            "DURAZNO"                         
 [87] "ENELDO"                           "ESPARRAGO"                       
 [89] "ESPARTO"                          "ESPINACA"                        
 [91] "ESTROPAJO"                        "EUCALIPTO BABY BLUE"             
 [93] "FEIJOA"                           "FIQUE"                           
 [95] "FITOSPORUM"                       "FLOR DE JAMAICA"                 
 [97] "FLORES Y FOLLAJES"                "FLOR DE SAFARI"                  
 [99] "FRESA"                            "FRAMBUESA"                       
[101] "FRIJOL"                           "GARBANZO"                        
[103] "GUANABANA"                        "FRUTALES VARIOS"                 
[105] "GIRASOL"                          "GLADIOLO"                        
[107] "GRANADILLA"                       "GUAMA"                           
[109] "GUANDUL"                          "GUATILA"                         
[111] "GUAYABA"                          "GULUPA"                          
[113] "HABA"                             "HABICHUELA"                      
[115] "IRACA"                            "HELECHO"                         
[117] "HELICONIA"                        "HIERBABUENA"                     
[119] "HIGO"                             "HIGUERILLA"                      
[121] "HORTALIZAS VARIAS"                "HORTENSIA"                       
[123] "JATROPHA"                         "JENGIBRE"                        
[125] "LECHUGA"                          "LAUREL"                          
[127] "LIMA"                             "LENTEJA"                         
[129] "LIMON"                            "LIMONARIA"                       
[131] "LIMONIUM"                         "LULO"                            
[133] "MACADAMIA"                        "MAIZ FORRAJERO"                  
[135] "MAIZ"                             "MANDARINA"                       
[137] "MAMEY"                            "MAMONCILLO"                      
[139] "MANGO"                            "MANGOSTINO"                      
[141] "MANI"                             "MANZANA"                         
[143] "MANZANILLA"                       "MARACUYA"                        
[145] "MARAÑON"                          "MELON"                           
[147] "MENTA"                            "SORGO"                           
[149] "MIMBRE"                           "MORA"                            
[151] "MORERA"                           "MORINGA"                         
[153] "NABO"                             "NARANJA"                         
[155] "ÑAME"                             "NISPERO"                         
[157] "NONI"                             "PAPAYA"                          
[159] "OREGANO"                          "ORELLANA"                        
[161] "ORQUIDEA"                         "PALMA AMARGA"                    
[163] "PALMA DE ACEITE"                  "PALMA ROBELINA"                  
[165] "PALMITO"                          "PAPA"                            
[167] "PAPAYUELA"                        "PATILLA"                         
[169] "PEPA DE PAN"                      "PEPINO COHOMBRO"                 
[171] "PERA"                             "PEPINO GUISO"                    
[173] "PEREJIL"                          "PIMENTON"                        
[175] "PIÑA"                             "PIMIENTA"                        
[177] "PITAHAYA"                         "QUINUA"                          
[179] "PLANTAS AROMATICAS"               "PLANTAS AROMATICAS Y MEDICINALES"
[181] "PLANTAS MEDICINALES"              "POLEO"                           
[183] "POMARROSA"                        "POMELO"                          
[185] "CRISANTEMO"                       "PROTEA"                          
[187] "PUERRO"                           "RABANO"                          
[189] "RAMBUTAN"                         "REMOLACHA"                       
[191] "REPOLLO"                          "ROMERO"                          
[193] "ROSA"                             "RUBA"                            
[195] "RUDA"                             "RUSCUS"                          
[197] "SABILA"                           "SACHA INCHI"                     
[199] "SOYA"                             "STATICE"                         
[201] "STEVIA"                           "TABACO NEGRO"                    
[203] "TABACO RUBIO"                     "TRIGO"                           
[205] "TAMARINDO"                        "TANGARANA"                       
[207] "TANGELO"                          "TE"                              
[209] "TOMATE"                           "TOMATE DE ARBOL"                 
[211] "TOMILLO"                          "TORONJA"                         
[213] "TREE FERN"                        "UCHUVA"                          
[215] "ULLUCO"                           "UMARI"                           
[217] "UVA"                              "UVA CAIMARONA"                   
[219] "VAINILLA"                         "YACON"                           
[221] "YUCA"                             "ZANAHORIA"                       
[223] "ZAPOTE"                          

observamos que la base de datos cuenta con entradas del cultivo de caucho

datos: datosc1

Filtramos por el cultivo de caucho

datosc1 <- datos_caucho1 %>% 
  filter(cultivo =="CAUCHO")
datosc1 %>% 
  head()
# A tibble: 6 × 10
  cod_dep departamento cod_mun municipio   cultivo  year area_sembrada_ha
    <dbl> <chr>          <dbl> <chr>       <chr>   <dbl>            <dbl>
1      13 BOLIVAR        13670 SAN PABLO   CAUCHO   2009              230
2      13 BOLIVAR        13160 CANTAGALLO  CAUCHO   2009                6
3      17 CALDAS         17867 VICTORIA    CAUCHO   2009              578
4      17 CALDAS         17444 MARQUETALIA CAUCHO   2009              230
5      17 CALDAS         17662 SAMANA      CAUCHO   2009              194
6      17 CALDAS         17777 SUPIA       CAUCHO   2009               25
# ℹ 3 more variables: area_cosechada_ha <dbl>, produccion_t <dbl>,
#   rendimiento_t_ha <dbl>
unique(datosc1$cultivo)
[1] "CAUCHO"

observemos la estructura y el resumen de la nueva base de datos

glimpse(datosc1)
Rows: 1,327
Columns: 10
$ cod_dep           <dbl> 13, 13, 17, 17, 17, 17, 50, 50, 50, 50, 50, 50, 50, …
$ departamento      <chr> "BOLIVAR", "BOLIVAR", "CALDAS", "CALDAS", "CALDAS", …
$ cod_mun           <dbl> 13670, 13160, 17867, 17444, 17662, 17777, 50689, 500…
$ municipio         <chr> "SAN PABLO", "CANTAGALLO", "VICTORIA", "MARQUETALIA"…
$ cultivo           <chr> "CAUCHO", "CAUCHO", "CAUCHO", "CAUCHO", "CAUCHO", "C…
$ year              <dbl> 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009…
$ area_sembrada_ha  <dbl> 230, 6, 578, 230, 194, 25, 40, 39, 25, 19, 14, 11, 1…
$ area_cosechada_ha <dbl> 0, 0, 37, 25, 50, 25, 9, 10, 22, 10, 0, 7, 0, 3, 66,…
$ produccion_t      <dbl> 0, 0, 59, 36, 65, 38, 12, 13, 29, 13, 0, 9, 0, 4, 96…
$ rendimiento_t_ha  <dbl> NA, NA, 1.59, 1.44, 1.30, 1.52, 1.30, 1.30, 1.30, 1.…

De una base promordial de dimensiones 206,068x17 pasó a 1,327x10.

summary(datosc1)
    cod_dep      departamento          cod_mun       municipio        
 Min.   : 5.00   Length:1327        Min.   : 5031   Length:1327       
 1st Qu.:17.00   Class :character   1st Qu.:17867   Class :character  
 Median :25.00   Mode  :character   Median :25662   Mode  :character  
 Mean   :41.16                      Mean   :41596                     
 3rd Qu.:68.00                      3rd Qu.:68385                     
 Max.   :99.00                      Max.   :99773                     
                                                                      
   cultivo               year      area_sembrada_ha  area_cosechada_ha
 Length:1327        Min.   :2007   Min.   :    1.0   Min.   :   0.00  
 Class :character   1st Qu.:2010   1st Qu.:   30.0   1st Qu.:   0.00  
 Mode  :character   Median :2013   Median :  124.0   Median :  10.00  
                    Mean   :2013   Mean   :  414.7   Mean   :  95.57  
                    3rd Qu.:2016   3rd Qu.:  397.5   3rd Qu.:  62.00  
                    Max.   :2018   Max.   :14128.0   Max.   :2149.00  
                                                                      
  produccion_t    rendimiento_t_ha
 Min.   :   0.0   Min.   :0.070   
 1st Qu.:   0.0   1st Qu.:0.900   
 Median :  12.0   Median :1.200   
 Mean   : 120.8   Mean   :1.204   
 3rd Qu.:  63.0   3rd Qu.:1.450   
 Max.   :4298.0   Max.   :8.700   
                  NA's   :436     

HASTA AQUÍ TENEMOS LA PRIMERA BASE DE DATOS: datosc1

Dspuración datos2

Estructura Eva2

glimpse(caucho_eva2)
Rows: 115,572
Columns: 18
$ `Código Dane departamento`      <chr> "05", "05", "05", "05", "05", "05", "0…
$ Departamento                    <chr> "Antioquia", "Antioquia", "Antioquia",…
$ `Código Dane municipio`         <chr> "05002", "05002", "05002", "05002", "0…
$ Municipio                       <chr> "Abejorral", "Abejorral", "Abejorral",…
$ `Grupo cultivo`                 <chr> "Frutales", "Frutales", "Frutales", "F…
$ Subgrupo                        <chr> "Demás frutales", "Demás frutales", "D…
$ Cultivo                         <chr> "Aguacate", "Aguacate", "Aguacate", "A…
$ `Desagregación cultivo`         <chr> "Aguacate demás variedades", "Aguacate…
$ Año                             <dbl> 2019, 2020, 2021, 2022, 2023, 2019, 20…
$ Periodo                         <chr> "2019", "2020", "2021", "2022", "2023"…
$ `Área sembrada`                 <dbl> 807.00, 857.00, 1007.00, 4307.00, 3807…
$ `Área cosechada`                <dbl> 506.00, 707.00, 707.00, 3857.00, 1007.…
$ Producción                      <dbl> 9614.00, 13433.00, 13433.00, 73283.00,…
$ Rendimiento                     <dbl> 19.00, 19.00, 19.00, 19.00, 19.00, 15.…
$ `Ciclo del cultivo`             <chr> "Permanente", "Permanente", "Permanent…
$ `Estado físico del cultivo`     <chr> "En fresco", "En fresco", "En fresco",…
$ `Código del cultivo`            <dbl> 2040299, 2040201, 2040201, 2040201, 20…
$ `Nombre científico del cultivo` <chr> "Persea americana", "Persea americana"…
  1. 115,572 filas x 18 columnas-una variable más
  2. Interesada en las varibles de codigo de departamento, departamento, codigo de municipio, municipio, cultivo, año, area sembrada, area cosechada, producciin y rendimeinto
  3. El tipo de datos corresponde a la naturaleza de las variables
  4. Los nombres de las variables se deben pasar a minusculas y quitar espacios

Resumen General EVa2

summary(caucho_eva2)
 Código Dane departamento Departamento       Código Dane municipio
 Length:115572            Length:115572      Length:115572        
 Class :character         Class :character   Class :character     
 Mode  :character         Mode  :character   Mode  :character     
                                                                  
                                                                  
                                                                  
  Municipio         Grupo cultivo        Subgrupo           Cultivo         
 Length:115572      Length:115572      Length:115572      Length:115572     
 Class :character   Class :character   Class :character   Class :character  
 Mode  :character   Mode  :character   Mode  :character   Mode  :character  
                                                                            
                                                                            
                                                                            
 Desagregación cultivo      Año         Periodo          Área sembrada    
 Length:115572         Min.   :2019   Length:115572      Min.   :    0.0  
 Class :character      1st Qu.:2020   Class :character   1st Qu.:    6.0  
 Mode  :character      Median :2021   Mode  :character   Median :   20.0  
                       Mean   :2021                      Mean   :  233.7  
                       3rd Qu.:2022                      3rd Qu.:   97.0  
                       Max.   :2023                      Max.   :60000.0  
 Área cosechada      Producción       Rendimiento     Ciclo del cultivo 
 Min.   :    0.0   Min.   :      0   Min.   :  0.00   Length:115572     
 1st Qu.:    5.0   1st Qu.:     23   1st Qu.:  1.90   Class :character  
 Median :   18.1   Median :    108   Median :  6.00   Mode  :character  
 Mean   :  214.3   Mean   :   3214   Mean   : 10.69                     
 3rd Qu.:   85.0   3rd Qu.:    575   3rd Qu.: 13.00                     
 Max.   :61000.0   Max.   :4776340   Max.   :640.00                     
 Estado físico del cultivo Código del cultivo Nombre científico del cultivo
 Length:115572             Min.   :1010101    Length:115572                
 Class :character          1st Qu.:1051400    Class :character             
 Mode  :character          Median :1080400    Mode  :character             
                           Mean   :1436985                                 
                           3rd Qu.:2041400                                 
                           Max.   :2080300                                 

NO se observan entradas en blanco o NA

Limpieza de variables

caucho_eva2l <- caucho_eva2 %>% 
  clean_names()
caucho_eva2l
# A tibble: 115,572 × 18
   codigo_dane_departamento departamento codigo_dane_municipio municipio
   <chr>                    <chr>        <chr>                 <chr>    
 1 05                       Antioquia    05002                 Abejorral
 2 05                       Antioquia    05002                 Abejorral
 3 05                       Antioquia    05002                 Abejorral
 4 05                       Antioquia    05002                 Abejorral
 5 05                       Antioquia    05002                 Abejorral
 6 05                       Antioquia    05002                 Abejorral
 7 05                       Antioquia    05002                 Abejorral
 8 05                       Antioquia    05002                 Abejorral
 9 05                       Antioquia    05002                 Abejorral
10 05                       Antioquia    05002                 Abejorral
# ℹ 115,562 more rows
# ℹ 14 more variables: grupo_cultivo <chr>, subgrupo <chr>, cultivo <chr>,
#   desagregacion_cultivo <chr>, ano <dbl>, periodo <chr>, area_sembrada <dbl>,
#   area_cosechada <dbl>, produccion <dbl>, rendimiento <dbl>,
#   ciclo_del_cultivo <chr>, estado_fisico_del_cultivo <chr>,
#   codigo_del_cultivo <dbl>, nombre_cientifico_del_cultivo <chr>

Corroboramos limpieza

glimpse(caucho_eva2l)
Rows: 115,572
Columns: 18
$ codigo_dane_departamento      <chr> "05", "05", "05", "05", "05", "05", "05"…
$ departamento                  <chr> "Antioquia", "Antioquia", "Antioquia", "…
$ codigo_dane_municipio         <chr> "05002", "05002", "05002", "05002", "050…
$ municipio                     <chr> "Abejorral", "Abejorral", "Abejorral", "…
$ grupo_cultivo                 <chr> "Frutales", "Frutales", "Frutales", "Fru…
$ subgrupo                      <chr> "Demás frutales", "Demás frutales", "Dem…
$ cultivo                       <chr> "Aguacate", "Aguacate", "Aguacate", "Agu…
$ desagregacion_cultivo         <chr> "Aguacate demás variedades", "Aguacate H…
$ ano                           <dbl> 2019, 2020, 2021, 2022, 2023, 2019, 2020…
$ periodo                       <chr> "2019", "2020", "2021", "2022", "2023", …
$ area_sembrada                 <dbl> 807.00, 857.00, 1007.00, 4307.00, 3807.0…
$ area_cosechada                <dbl> 506.00, 707.00, 707.00, 3857.00, 1007.00…
$ produccion                    <dbl> 9614.00, 13433.00, 13433.00, 73283.00, 1…
$ rendimiento                   <dbl> 19.00, 19.00, 19.00, 19.00, 19.00, 15.00…
$ ciclo_del_cultivo             <chr> "Permanente", "Permanente", "Permanente"…
$ estado_fisico_del_cultivo     <chr> "En fresco", "En fresco", "En fresco", "…
$ codigo_del_cultivo            <dbl> 2040299, 2040201, 2040201, 2040201, 2040…
$ nombre_cientifico_del_cultivo <chr> "Persea americana", "Persea americana", …

Seleccionamos variables de interés

datos_caucho2 <- caucho_eva2l %>% 
  select(-grupo_cultivo ,-subgrupo, -desagregacion_cultivo,- periodo,-estado_fisico_del_cultivo, -nombre_cientifico_del_cultivo, -ciclo_del_cultivo) %>% 
  rename(
    year = ano
  )
datos_caucho2 
# A tibble: 115,572 × 11
   codigo_dane_departamento departamento codigo_dane_municipio municipio cultivo
   <chr>                    <chr>        <chr>                 <chr>     <chr>  
 1 05                       Antioquia    05002                 Abejorral Aguaca…
 2 05                       Antioquia    05002                 Abejorral Aguaca…
 3 05                       Antioquia    05002                 Abejorral Aguaca…
 4 05                       Antioquia    05002                 Abejorral Aguaca…
 5 05                       Antioquia    05002                 Abejorral Aguaca…
 6 05                       Antioquia    05002                 Abejorral Banano 
 7 05                       Antioquia    05002                 Abejorral Banano 
 8 05                       Antioquia    05002                 Abejorral Banano 
 9 05                       Antioquia    05002                 Abejorral Banano 
10 05                       Antioquia    05002                 Abejorral Banano 
# ℹ 115,562 more rows
# ℹ 6 more variables: year <dbl>, area_sembrada <dbl>, area_cosechada <dbl>,
#   produccion <dbl>, rendimiento <dbl>, codigo_del_cultivo <dbl>

agrupar por el cultivo de interés = Caucho

unique(datos_caucho2$cultivo)
  [1] "Aguacate"                                                         
  [2] "Banano"                                                           
  [3] "Cacao"                                                            
  [4] "Café"                                                             
  [5] "Caña"                                                             
  [6] "Frijol"                                                           
  [7] "Limón"                                                            
  [8] "Lulo"                                                             
  [9] "Maíz"                                                             
 [10] "Mango"                                                            
 [11] "Mora"                                                             
 [12] "Papa"                                                             
 [13] "Plátano"                                                          
 [14] "Tomate de árbol"                                                  
 [15] "Ají"                                                              
 [16] "Arracacha"                                                        
 [17] "Arveja"                                                           
 [18] "Cebolla de bulbo"                                                 
 [19] "Cilantro"                                                         
 [20] "Durazno o albaricoque"                                            
 [21] "Guanábana"                                                        
 [22] "Lima"                                                             
 [23] "Mandarina"                                                        
 [24] "Naranja"                                                          
 [25] "Otros cítricos"                                                   
 [26] "Pepino Cohombro"                                                  
 [27] "Pimentón"                                                         
 [28] "Tabaco"                                                           
 [29] "Tomate"                                                           
 [30] "Yuca"                                                             
 [31] "Ahuyama"                                                          
 [32] "Cebolla de rama"                                                  
 [33] "Granadilla"                                                       
 [34] "Gulupa o cholupa"                                                 
 [35] "Habichuela"                                                       
 [36] "Lechuga"                                                          
 [37] "Repollo"                                                          
 [38] "Zanahoria"                                                        
 [39] "Arroz"                                                            
 [40] "Mangostino"                                                       
 [41] "Maracuyá"                                                         
 [42] "Palma de aceite"                                                  
 [43] "Patilla"                                                          
 [44] "Piña"                                                             
 [45] "Plantas aromáticas"                                               
 [46] "Soya"                                                             
 [47] "Coco"                                                             
 [48] "Ñame"                                                             
 [49] "Guayaba"                                                          
 [50] "Otras hortalizas"                                                 
 [51] "Pitahaya"                                                         
 [52] "Zapote"                                                           
 [53] "Badea"                                                            
 [54] "Melón"                                                            
 [55] "Papaya"                                                           
 [56] "Uva"                                                              
 [57] "Algodón"                                                          
 [58] "Anón"                                                             
 [59] "Sábila"                                                           
 [60] "Sorgo"                                                            
 [61] "Fique"                                                            
 [62] "Fresa"                                                            
 [63] "Iraca"                                                            
 [64] "Sacha inchi"                                                      
 [65] "Batata"                                                           
 [66] "Malanga, achín, yota, papa china, bore"                           
 [67] "Pomelo"                                                           
 [68] "Achira"                                                           
 [69] "Maní"                                                             
 [70] "Tangelo"                                                          
 [71] "Ajonjolí"                                                         
 [72] "Arazá"                                                            
 [73] "Chontaduro"                                                       
 [74] "Haba"                                                             
 [75] "Berenjena"                                                        
 [76] "Col"                                                              
 [77] "Curuba"                                                           
 [78] "Calabacín, calabaza"                                              
 [79] "Guatila"                                                          
 [80] "Pepino Guiso"                                                     
 [81] "Borojó"                                                           
 [82] "Uchuva"                                                           
 [83] "Chirimoya"                                                        
 [84] "Espárrago"                                                        
 [85] "Morera"                                                           
 [86] "Papayuela -Babaco"                                                
 [87] "Arándano"                                                         
 [88] "Macadamia"                                                        
 [89] "Achiote"                                                          
 [90] "Ciruela"                                                          
 [91] "Guandul"                                                          
 [92] "Chiraran - albahaca"                                              
 [93] "Cúrcuma o azafrán"                                                
 [94] "Rambután"                                                         
 [95] "Asaí"                                                             
 [96] "Copoazú"                                                          
 [97] "Ajo"                                                              
 [98] "Avena"                                                            
 [99] "Cebada"                                                           
[100] "Feijoa"                                                           
[101] "Trigo"                                                            
[102] "Ulluco"                                                           
[103] "Moringa"                                                          
[104] "Chamba"                                                           
[105] "Apio"                                                             
[106] "Garbanzo"                                                         
[107] "Quinua"                                                           
[108] "Cimarrón"                                                         
[109] "Higo"                                                             
[110] "Níspero"                                                          
[111] "Otros cultivos para condimentos, bebidas medicinales y aromáticas"
[112] "Ruscus"                                                           
[113] "Brevo"                                                            
[114] "Manzana"                                                          
[115] "Remolacha"                                                        
[116] "Acelga"                                                           
[117] "Brócoli"                                                          
[118] "Coliflor"                                                         
[119] "Espinaca"                                                         
[120] "Otros frutales"                                                   
[121] "Perejil"                                                          
[122] "Stevia"                                                           
[123] "Millo"                                                            
[124] "Mamoncillo"                                                       
[125] "Cardamomo"                                                        
[126] "Nabo"                                                             
[127] "Uva Caimarona"                                                    
[128] "Noni"                                                             
[129] "Marañón"                                                          
[130] "Agraz - mortiño"                                                  
[131] "Rábano"                                                           
[132] "Manzanilla"                                                       
[133] "Hibias, ocas"                                                     
[134] "Otras raíces y tubérculos"                                        
[135] "Albahaca"                                                         
[136] "Arbol de pan o pepa del pan"                                      
[137] "Higuerilla"                                                       
[138] "Romero"                                                           
[139] "Corozo"                                                           
[140] "Guama"                                                            
[141] "Jengibre"                                                         
[142] "Orégano"                                                          
[143] "Toronja"                                                          
[144] "Toronjil"                                                         
[145] "Limonaria"                                                        
[146] "Ruda"                                                             
[147] "Tomillo"                                                          
[148] "Frambuesa"                                                        
[149] "Pera"                                                             
[150] "Caimo"                                                            
[151] "Té"                                                               
[152] "Laurel"                                                           
[153] "Otros caducifolios"                                               
[154] "Alcachofa"                                                        
[155] "Palmito"                                                          
[156] "Pimienta"                                                         
[157] "Tamarindo"                                                        
[158] "Carambolo"                                                        
[159] "Dátil"                                                            
[160] "Menta"                                                            
[161] "Olivo"                                                            
[162] "Otros cultivos tropicales tradicionales"                          

HASTA AQUÍ TENEMOS LA SEGUNDA BASE DE DATOS: No existen datos para el cultivo de caucho en la eva 2019-2023

Poducción

Observemos la variable producción

A nivel nacional

caucho_pnal <- datosc1 %>% 
  summarize(produccion_total = sum(produccion_t, na.rm = TRUE),
            media = mean(produccion_t, na.rm=TRUE), 
            desviación = sd(produccion_t, na.rm=TRUE))
caucho_pnal 
# A tibble: 1 × 3
  produccion_total media desviación
             <dbl> <dbl>      <dbl>
1           160296  121.       341.

por año

datosp_year <- 
  datosc1 %>% 
  group_by(year) %>% 
  summarise(area_cosechada_total_ha = sum(area_cosechada_ha, na.rm = TRUE),
            promedio_area_cosechada_ha = mean(area_cosechada_ha, na.rm = TRUE),
            produccion_total_t = sum(produccion_t, na.rm = TRUE),
            promedio_produccion_total_t = mean(produccion_t, na.rm = TRUE),
             ) 
datosp_year
# A tibble: 12 × 5
    year area_cosechada_total_ha promedio_area_cosechada_ha produccion_total_t
   <dbl>                   <dbl>                      <dbl>              <dbl>
 1  2007                    2600                       31.3               3730
 2  2008                    2933                       29.6               3431
 3  2009                    4057                       39.0               4725
 4  2010                    5123                       47.4               6176
 5  2011                    7502                       68.8               9654
 6  2012                    6619                       64.3               9648
 7  2013                    8932                       76.3              11512
 8  2014                   12927                      110.               16524
 9  2015                   15573                      127.               20131
10  2016                   18434                      147.               22858
11  2017                   20377                      171.               24719
12  2018                   21750                      183.               27188
# ℹ 1 more variable: promedio_produccion_total_t <dbl>

Visualicemos area cosechada y producción por año

vp1 <- datosp_year %>%
  tail(10) %>%
  ggplot(aes(x=year, y=area_cosechada_total_ha)) +
    geom_line(color="#69b3a2") +
    geom_point(color="#69b3a2", size=2) +
    geom_text(aes(label=area_cosechada_total_ha), vjust = -0.5, size=2.8)+
    ggtitle("Area cosechada por año") +
    ylab("area cosechada ha") 

  vp2 <- datosp_year %>%
  tail(10) %>%
  ggplot( aes(x=year, y=produccion_total_t)) +
    geom_line(color="#69b3a2") +
    geom_point(color="#69b3a2", size=2) +
    geom_text(aes(label=produccion_total_t), vjust = -0.5, size=2.8
              )+
    ggtitle("producción año en toneladas") +
    ylab("producción total de latex por año)") + 
    ylim(0,30000)

vp1+vp2

  1. Promedio nacional,en estos 11 años, ha sido de 120.7 toneladas
  2. con apreciable dispersión entre los datos
  3. El año con mejor promedio de producción ha sido 2018 con 228.47 toneladas.
  4. El peor año ha sido 2008 con solo 34.65 tonelada de producción en promedio.¿A qué se debió?
  5. para el año 2007 se registraba un rendimiento de 1.16 t/h. Para el año 2018 se registró un rendimiento de 1.25 t/h en la produción nacional anual de latex.

por departamento

unique(datosc1$departamento
        )
 [1] "BOLIVAR"            "CALDAS"             "META"              
 [4] "CAQUETA"            "PUTUMAYO"           "QUINDIO"           
 [7] "ANTIOQUIA"          "CASANARE"           "CORDOBA"           
[10] "CUNDINAMARCA"       "GUAVIARE"           "SANTANDER"         
[13] "CESAR"              "VICHADA"            "GUAINIA"           
[16] "TOLIMA"             "NORTE DE SANTANDER"
datosp_depar <-
   datosc1 %>% 
  group_by(departamento) %>% 
  summarise(area_cosechada_total_ha = sum(area_cosechada_ha, na.rm = TRUE),
            promedio_area_cosechada_ha = mean(area_cosechada_ha, na.rm = TRUE),
            produccion_total_t = sum(produccion_t, na.rm = TRUE),
            promedio_produccion_total_t = mean(produccion_t, na.rm = TRUE),
             ) %>% 
  
  arrange(desc(produccion_total_t))
datosp_depar
# A tibble: 17 × 5
   departamento area_cosechada_total…¹ promedio_area_cosech…² produccion_total_t
   <chr>                         <dbl>                  <dbl>              <dbl>
 1 SANTANDER                     41862                 238.                47617
 2 CAQUETA                       27010                 144.                32703
 3 META                          17542                  80.1               27755
 4 ANTIOQUIA                     15210                  61.3               24071
 5 CALDAS                         8546                 158.                12486
 6 CORDOBA                        7079                 157.                 5419
 7 GUAVIARE                       4006                  83.5                5045
 8 CUNDINAMARCA                   1547                  16.6                1633
 9 PUTUMAYO                       1970                  22.6                1270
10 TOLIMA                          420                  38.2                1072
11 CASANARE                        759                  11.3                 607
12 BOLIVAR                         688                  20.8                 439
13 CESAR                           100                   5.88                100
14 GUAINIA                          40                   5.71                 60
15 QUINDIO                          48                   4.8                  19
16 NORTE DE SA…                      0                   0                     0
17 VICHADA                           0                   0                     0
# ℹ abbreviated names: ¹​area_cosechada_total_ha, ²​promedio_area_cosechada_ha
# ℹ 1 more variable: promedio_produccion_total_t <dbl>
  1. Los departamentode de Santander. Cladas, Caquetá y Meta sobrepasan el promedio nacional de 120 toneladas
  2. Antioquia tiene un promedio de 97 toneladas en estos 11 años.

Visualicemos el promedio de produción por departamento

datosc1 %>% 
  ggplot(aes(x = departamento, y = produccion_t)) +
  geom_boxplot() +
  scale_y_log10() +
  labs(x = "Departamento",
       y = "producción total (t)",
       title = "Producción de latex en toneladas por departamento",
       subtitle = "Colombia") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
Warning in scale_y_log10(): log-10 transformation introduced infinite values.
Warning: Removed 438 rows containing non-finite outside the scale range
(`stat_boxplot()`).

Observemos la producción anual de los primeros 5 departamentos

unique(datosp_depar$departamento)
 [1] "SANTANDER"          "CAQUETA"            "META"              
 [4] "ANTIOQUIA"          "CALDAS"             "CORDOBA"           
 [7] "GUAVIARE"           "CUNDINAMARCA"       "PUTUMAYO"          
[10] "TOLIMA"             "CASANARE"           "BOLIVAR"           
[13] "CESAR"              "GUAINIA"            "QUINDIO"           
[16] "NORTE DE SANTANDER" "VICHADA"           
DA <- datosc1 %>%
  filter(departamento=="ANTIOQUIA") %>% 
  group_by(year) %>% 
  summarise(produccion_total_t = sum(produccion_t, na.rm = TRUE)
             ) %>% 
  tail(10) %>%
  ggplot(aes(x=year, y=produccion_total_t)) +
    geom_line(color="#69b3a2") +
    geom_point(color="#69b3a2", size=2) +
    geom_text(aes(label=produccion_total_t), vjust = -0.5, size=2.8)+
    ggtitle("produccion de latex en Antoiquia") +
    ylab("produccion de latex (t)") 

DS <- datosc1 %>%
  filter(departamento=="SANTANDER") %>% 
  group_by(year) %>% 
  summarise(produccion_total_t = sum(produccion_t, na.rm = TRUE)
             ) %>% 
  tail(10) %>%
  ggplot(aes(x=year, y=produccion_total_t)) +
    geom_line(color="#69b3a2") +
    geom_point(color="#69b3a2", size=2) +
    geom_text(aes(label=produccion_total_t), vjust = -0.5, size=2.8)+
    ggtitle("produccion de latex en Santander") +
    ylab("produccion de latex (t)") 
DA+DS

  1. El departamento de Antioquia experimenta una caida en la producción anual de latex. Pasó de 4987 toneladas para 2016 a 1545 para 2017

¿Puede ser por la disminución del área cosechada? Veamos

DAAC <- datosc1 %>%
  filter(departamento=="ANTIOQUIA") %>% 
  group_by(year) %>% 
  summarise(area_cosechada_total_ha = sum(area_cosechada_ha, na.rm = TRUE),
             )  %>% 
  tail(10) %>%
  ggplot(aes(x=year, y=area_cosechada_total_ha))+
    geom_line(color="#69b3a2") +
    geom_point(color="#69b3a2", size=2) +
    geom_text(aes(label=area_cosechada_total_ha ), vjust = -0.5, size=2.8)+
    ggtitle("Area de caucho cosechada en Antioquia") +
    ylab("area cosechada (ha)") 
DAAC

Aquí corroboramos la casi relación de una a una (1:1) que existe entre el área cosechada y la producción

¿Cómo va la siembra?

names(datosc1)
 [1] "cod_dep"           "departamento"      "cod_mun"          
 [4] "municipio"         "cultivo"           "year"             
 [7] "area_sembrada_ha"  "area_cosechada_ha" "produccion_t"     
[10] "rendimiento_t_ha" 
DAAS <- datosc1 %>%
  filter(departamento=="ANTIOQUIA") %>% 
  group_by(year) %>% 
  summarise(area_total_sembrada_ha = sum(area_sembrada_ha, na.rm = TRUE),
             )  %>% 
  tail(10) %>%
  ggplot(aes(x=year, y=area_total_sembrada_ha))+
    geom_line(color="#69b3a2") +
    geom_point(color="#69b3a2", size=2) +
    geom_text(aes(label=area_total_sembrada_ha ), vjust = -0.5, size=2.8)+
    ggtitle("Area sembrada de caucho en Antioquia") +
    ylab("area sembrada (ha)") 
DAAS

Las áreas sembradas de Antioquia auguran una futura mejora en la producción de latex

Qué se sabe de El Bagre

caucho_elbagre <- datosc1 %>% 
  filter(departamento=="ANTIOQUIA") %>% 
  filter(cod_mun=="5250") %>% 
  group_by(year) %>% 
  summarise(area_cosechada_total_ha = sum(area_cosechada_ha, na.rm = TRUE),
            produccion_total_t = sum(produccion_t, na.rm = TRUE)
            )
caucho_elbagre
# A tibble: 12 × 3
    year area_cosechada_total_ha produccion_total_t
   <dbl>                   <dbl>              <dbl>
 1  2007                       0                  0
 2  2008                       0                  0
 3  2009                       0                  0
 4  2010                       0                  0
 5  2011                       0                  0
 6  2012                       0                  0
 7  2013                       0                  0
 8  2014                      13                 10
 9  2015                      70                 56
10  2016                      70                 63
11  2017                      70                 63
12  2018                      70                 63
MAEBA <- datosc1 %>%
  filter(cod_mun =="5250") %>% 
  group_by(year) %>% 
  summarise(area_total_cosechada_ha = sum(area_cosechada_ha, na.rm = TRUE)
             ) %>% 
  tail(10) %>%
  ggplot(aes(x=year, y=area_total_cosechada_ha)) +
    geom_line(color="#69b3a2") +
    geom_point(color="#69b3a2", size=2) +
    geom_text(aes(label=area_total_cosechada_ha), vjust = -0.5, size=2.8)+
    ggtitle("Áreas cosechadas en El Bagre") +
    ylab("area cosechada (ha)") 

MAEBP <- datosc1 %>%
  filter(cod_mun =="5250") %>% 
  group_by(year) %>% 
  summarise(produccion_total_t = sum(produccion_t, na.rm = TRUE)
             ) %>% 
  tail(10) %>%
  ggplot(aes(x=year, y=produccion_total_t)) +
    geom_line(color="#69b3a2") +
    geom_point(color="#69b3a2", size=2) +
    geom_text(aes(label=produccion_total_t), vjust = -0.5, size=2.8)+
    ggtitle("produccion de latex en El Bagre") +
    ylab("produccion de latex (t)") 


MAEBA +MAEBP 

  1. Sólo hasta 2014 se registran datos de área cosechada y producción para el municipio de El Bagre. b)Tanto el área cosechada como la producción se mantienes constantes desde 2016.

Veamos el área cultivada

MBAS <- datosc1 %>%
  filter(cod_mun=="5250") %>% 
  group_by(year) %>% 
  summarise(area_total_sembrada_ha = sum(area_sembrada_ha, na.rm = TRUE),
             )  %>% 
  tail(10) %>%
  ggplot(aes(x=year, y=area_total_sembrada_ha))+
    geom_line(color="#69b3a2") +
    geom_point(color="#69b3a2", size=2) +
    geom_text(aes(label=area_total_sembrada_ha ), vjust = -0.5, size=2.8)+
    ggtitle("Area sembrada de caucho en El Bagre") +
    ylab("area sembrada (ha)") 
MBAS

  1. El reporte de áreas cultivadas para El Bagre bajaron desde 482 ha para 2015, hasta las 255 ha. Esta última cifra se mantene constante en los años 2016, 2017 y 2018.
  2. Se augura un leve incremento en los reṕortes de producción de latex si la única variable que interviniera fuese el área cultivada.

Produccion Mundial

caucho_w <- read_csv("datos_caucho/datos_mundo/FAOSTAT_data_en_9-16-2024.csv")
Rows: 2382 Columns: 15
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (11): Domain Code, Domain, Area Code (M49), Area, Element, Item Code (CP...
dbl  (4): Element Code, Year Code, Year, Value

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
caucho_w %>% 
  head()
# A tibble: 6 × 15
  `Domain Code` Domain            `Area Code (M49)` Area  `Element Code` Element
  <chr>         <chr>             <chr>             <chr>          <dbl> <chr>  
1 QCL           Crops and livest… 050               Bang…           5312 Area h…
2 QCL           Crops and livest… 050               Bang…           5419 Yield  
3 QCL           Crops and livest… 050               Bang…           5510 Produc…
4 QCL           Crops and livest… 050               Bang…           5312 Area h…
5 QCL           Crops and livest… 050               Bang…           5419 Yield  
6 QCL           Crops and livest… 050               Bang…           5510 Produc…
# ℹ 9 more variables: `Item Code (CPC)` <chr>, Item <chr>, `Year Code` <dbl>,
#   Year <dbl>, Unit <chr>, Value <dbl>, Flag <chr>, `Flag Description` <chr>,
#   Note <chr>

Vemos las variables y sus características

names(caucho_w)
 [1] "Domain Code"      "Domain"           "Area Code (M49)"  "Area"            
 [5] "Element Code"     "Element"          "Item Code (CPC)"  "Item"            
 [9] "Year Code"        "Year"             "Unit"             "Value"           
[13] "Flag"             "Flag Description" "Note"            

a)Estoy interesada en las variables:Area,Year, Unit,Element y Value

glimpse(caucho_w)
Rows: 2,382
Columns: 15
$ `Domain Code`      <chr> "QCL", "QCL", "QCL", "QCL", "QCL", "QCL", "QCL", "Q…
$ Domain             <chr> "Crops and livestock products", "Crops and livestoc…
$ `Area Code (M49)`  <chr> "050", "050", "050", "050", "050", "050", "050", "0…
$ Area               <chr> "Bangladesh", "Bangladesh", "Bangladesh", "Banglade…
$ `Element Code`     <dbl> 5312, 5419, 5510, 5312, 5419, 5510, 5312, 5419, 551…
$ Element            <chr> "Area harvested", "Yield", "Production", "Area harv…
$ `Item Code (CPC)`  <chr> "01950.01", "01950.01", "01950.01", "01950.01", "01…
$ Item               <chr> "Natural rubber in primary forms", "Natural rubber …
$ `Year Code`        <dbl> 2000, 2000, 2000, 2001, 2001, 2001, 2002, 2002, 200…
$ Year               <dbl> 2000, 2000, 2000, 2001, 2001, 2001, 2002, 2002, 200…
$ Unit               <chr> "ha", "100 g/ha", "t", "ha", "100 g/ha", "t", "ha",…
$ Value              <dbl> 23000, 1000, 2300, 57000, 1000, 5700, 52000, 1000, …
$ Flag               <chr> "E", "E", "X", "E", "E", "X", "E", "E", "X", "I", "…
$ `Flag Description` <chr> "Estimated value", "Estimated value", "Figure from …
$ Note               <chr> NA, NA, "Unofficial figure", NA, NA, "Unofficial fi…
  1. Dataframe con 2382 filas x 15 columnas
  2. Importante que la variable Value se de tipo numperico

Limpiermos nombre de Variables y seleccionemos variables

caucho_w1 <- caucho_w %>% 
  select(Area, Element,Year,Unit, Value) %>% 
  clean_names() %>% 
  rename(
    pais=area, 
    varaible_productiva=element, 
    unidad=unit,
    cantidad=value
  ) 
caucho_w1 %>% 
  head()
# A tibble: 6 × 5
  pais       varaible_productiva  year unidad   cantidad
  <chr>      <chr>               <dbl> <chr>       <dbl>
1 Bangladesh Area harvested       2000 ha          23000
2 Bangladesh Yield                2000 100 g/ha     1000
3 Bangladesh Production           2000 t            2300
4 Bangladesh Area harvested       2001 ha          57000
5 Bangladesh Yield                2001 100 g/ha     1000
6 Bangladesh Production           2001 t            5700

Veamos área productiva y producción por país

Cuántos paises participan en la producción de caucho en su forma primaria o leatex

unique(caucho_w1$pais)
 [1] "Bangladesh"                       "Bolivia (Plurinational State of)"
 [3] "Brazil"                           "Brunei Darussalam"               
 [5] "Cambodia"                         "Cameroon"                        
 [7] "Central African Republic"         "China"                           
 [9] "China, mainland"                  "Colombia"                        
[11] "Congo"                            "Costa Rica"                      
[13] "Côte d'Ivoire"                    "Democratic Republic of the Congo"
[15] "Dominican Republic"               "Ecuador"                         
[17] "Gabon"                            "Ghana"                           
[19] "Guatemala"                        "Guinea"                          
[21] "Guinea-Bissau"                    "India"                           
[23] "Indonesia"                        "Lao People's Democratic Republic"
[25] "Liberia"                          "Malaysia"                        
[27] "Mexico"                           "Myanmar"                         
[29] "Nigeria"                          "Papua New Guinea"                
[31] "Peru"                             "Philippines"                     
[33] "Singapore"                        "Sri Lanka"                       
[35] "Thailand"                         "Timor-Leste"                     
[37] "Viet Nam"                        

37 paises se registran como productores de latex de caucho

Area

caucho_w1a <- caucho_w1 %>% 
  filter(varaible_productiva=="Area harvested") %>% 
  group_by(pais) %>% 
  summarise(
    total_area_productiva_ha = sum(cantidad, na.rm=TRUE)
  ) %>% 
  arrange(desc(total_area_productiva_ha))
  caucho_w1a
# A tibble: 37 × 2
   pais            total_area_productiva_ha
   <chr>                              <dbl>
 1 Indonesia                       75773393
 2 Thailand                        54833014
 3 Malaysia                        26885482
 4 China                           13639081
 5 China, mainland                 13639081
 6 Viet Nam                        11178598
 7 India                            9550356
 8 Nigeria                          8087213
 9 Côte d'Ivoire                    5535366
10 Myanmar                          4739292
# ℹ 27 more rows

Producción

caucho_w1p <- caucho_w1 %>% 
  filter(varaible_productiva=="Production") %>% 
  group_by(pais) %>% 
  summarise(
    total_produccion_t = sum(cantidad, na.rm=TRUE)
  ) %>% 
  arrange(desc(total_produccion_t))
  caucho_w1p
# A tibble: 37 × 2
   pais            total_produccion_t
   <chr>                        <dbl>
 1 Thailand                 85763814.
 2 Indonesia                62880487 
 3 Malaysia                 19486617.
 4 Viet Nam                 18325056.
 5 India                    18200220.
 6 China                    15774817 
 7 China, mainland          15774817 
 8 Côte d'Ivoire             9043252.
 9 Philippines               8660000.
10 Guatemala                 4668413.
# ℹ 27 more rows

Los 4 primeros paises con mayor área de producción y producción son: 1)Tailandia (54.833.014 ha - 85.763.813 t) con 20.940.379 menos de ha que indonesia. 2) Indonesia (75.773.393 ha- 62.880.487t). 3) Malasia (26.885.482 ha- 19486617 t) 4) Vietnam (11.178.598 ha- 18.325.055 t) De sexto en areas productivas. Colombia se encuentra ubicada en el lugar 27 por area productiva (184.049 ha) y 28 por producción (124.702). Por detrás de paises de la region como: Guatemala (10, 19.986.314 ha, 668.413 t) Brazil (11, 3.044.129 ha, 3.591.047 t) Mexico (19, 453.281 ha, 1.146.777 t) Ecuador (22, 239.087 ha, 354.110 t) Bolivia (26, 90.162 ha, 222.599 t)

Visualicemos

caucho_w1p %>%
  filter(!is.na(total_produccion_t)) %>%
    ggplot( aes(x=reorder(pais, total_produccion_t), y=total_produccion_t) ) +
    geom_bar(stat="identity", fill="#69b3a2") +
    coord_flip() +
      theme(
      panel.grid.minor.y = element_blank(),
      panel.grid.major.y = element_blank(),
      legend.position="none"
    ) +
    xlab("") +
    ylab("Producción de caucho natural en su forma primaria")

Observemos la dinámica de la producción anual entre Tailandia y Colombia

Desde qué años se registran los datos

unique(caucho_w1$year)
 [1] 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014
[16] 2015 2016 2017 2018 2019 2020 2021 2022
cauchot_year <- caucho_w1 %>% 
  filter(pais=="Thailand") %>% 
  filter(varaible_productiva =="Production") %>% 
  group_by(year) %>% 
  summarise(produccion_anual_t = sum(cantidad)) %>% 
  ggplot(aes(x=year, y=produccion_anual_t))+
    geom_line(color="#69b3a2") +
    geom_point(color="#69b3a2", size=2) +
    geom_text(aes(label=produccion_anual_t ), vjust = -0.5, size=1.8)+
    ggtitle("Producción anual Tailandia") +
    ylab("Producción anual (t)") 
cauchot_year

Los Tailandeses duplicaron la producción anual de poco mas de dos millones a mas de 4 millones

cauchoc_year <- caucho_w1 %>% 
  filter(pais=="Colombia") %>% 
  filter(varaible_productiva =="Production") %>% 
  group_by(year) %>% 
  summarise(produccion_anual_t = sum(cantidad)) %>% 
  ggplot(aes(x=year, y=produccion_anual_t))+
    geom_line(color="#69b3a2") +
    geom_point(color="#69b3a2", size=2) +
    geom_text(aes(label=produccion_anual_t ), vjust = -0.5, size=1.8)+
    ggtitle("Producción anual Colombia") +
    ylab("Producción anual (t)") 
cauchoc_year

Valor de la producción Mundial

  • Fuente: Datos Abiertos de Colombia

  • FAOSTAT: https://www.fao.org/faostat/en/#data

world_p <- read_csv("datos_caucho/datos_mundo/FAOSTAT_RUBBER_VALORP.csv")
Rows: 27 Columns: 16
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (11): Domain Code, Domain, Area Code (M49), Area, Element, Item Code (CP...
dbl  (5): Element Code, Year Code, Year, Months Code, Value

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
world_p %>% 
  head()
# A tibble: 6 × 16
  `Domain Code` Domain          `Area Code (M49)` Area    `Element Code` Element
  <chr>         <chr>           <chr>             <chr>            <dbl> <chr>  
1 PP            Producer Prices 076               Brazil            5532 Produc…
2 PP            Producer Prices 076               Brazil            5532 Produc…
3 PP            Producer Prices 076               Brazil            5532 Produc…
4 PP            Producer Prices 156               China,…           5532 Produc…
5 PP            Producer Prices 214               Domini…           5532 Produc…
6 PP            Producer Prices 214               Domini…           5532 Produc…
# ℹ 10 more variables: `Item Code (CPC)` <chr>, Item <chr>, `Year Code` <dbl>,
#   Year <dbl>, `Months Code` <dbl>, Months <chr>, Unit <chr>, Value <dbl>,
#   Flag <chr>, `Flag Description` <chr>

Variables y características

glimpse(world_p)
Rows: 27
Columns: 16
$ `Domain Code`      <chr> "PP", "PP", "PP", "PP", "PP", "PP", "PP", "PP", "PP…
$ Domain             <chr> "Producer Prices", "Producer Prices", "Producer Pri…
$ `Area Code (M49)`  <chr> "076", "076", "076", "156", "214", "214", "214", "3…
$ Area               <chr> "Brazil", "Brazil", "Brazil", "China, mainland", "D…
$ `Element Code`     <dbl> 5532, 5532, 5532, 5532, 5532, 5532, 5532, 5532, 553…
$ Element            <chr> "Producer Price (USD/tonne)", "Producer Price (USD/…
$ `Item Code (CPC)`  <chr> "01950.01", "01950.01", "01950.01", "01950.01", "01…
$ Item               <chr> "Natural rubber in primary forms", "Natural rubber …
$ `Year Code`        <dbl> 2020, 2021, 2022, 2020, 2020, 2021, 2022, 2020, 202…
$ Year               <dbl> 2020, 2021, 2022, 2020, 2020, 2021, 2022, 2020, 202…
$ `Months Code`      <dbl> 7021, 7021, 7021, 7021, 7021, 7021, 7021, 7021, 702…
$ Months             <chr> "Annual value", "Annual value", "Annual value", "An…
$ Unit               <chr> "USD", "USD", "USD", "USD", "USD", "USD", "USD", "U…
$ Value              <dbl> 497.0, 693.3, 854.0, 2009.9, 1066.1, 1281.6, 1433.1…
$ Flag               <chr> "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "…
$ `Flag Description` <chr> "Official figure", "Official figure", "Official fig…
  1. Las variables que me interesan son: Areas o pais, year y value
  2. La variable value tiene el tiṕo de dato correspondinte a su naturaleza

Limpio datos

world_p1 <- world_p %>% 
  select(Area,Element,Year, Value) %>% 
  clean_names() %>% 
  rename(
    pais = area,
    usd_t = element,
    valor = value
  )
world_p1
# A tibble: 27 × 4
   pais               usd_t                       year valor
   <chr>              <chr>                      <dbl> <dbl>
 1 Brazil             Producer Price (USD/tonne)  2020  497 
 2 Brazil             Producer Price (USD/tonne)  2021  693.
 3 Brazil             Producer Price (USD/tonne)  2022  854 
 4 China, mainland    Producer Price (USD/tonne)  2020 2010.
 5 Dominican Republic Producer Price (USD/tonne)  2020 1066.
 6 Dominican Republic Producer Price (USD/tonne)  2021 1282.
 7 Dominican Republic Producer Price (USD/tonne)  2022 1433.
 8 Indonesia          Producer Price (USD/tonne)  2020  440 
 9 Indonesia          Producer Price (USD/tonne)  2021  540.
10 Indonesia          Producer Price (USD/tonne)  2022  536.
# ℹ 17 more rows

Veamos los paises que reciben ingresos por las formas primaria del caucho

unique(world_p1$pais
       )
 [1] "Brazil"             "China, mainland"    "Dominican Republic"
 [4] "Indonesia"          "Malaysia"           "Mexico"            
 [7] "Philippines"        "Sri Lanka"          "Thailand"          
[10] "Viet Nam"          
unique(world_p1$year)
[1] 2020 2021 2022

Para Brazil

world_p1 %>% 
  filter(pais=="Brazil")
# A tibble: 3 × 4
  pais   usd_t                       year valor
  <chr>  <chr>                      <dbl> <dbl>
1 Brazil Producer Price (USD/tonne)  2020  497 
2 Brazil Producer Price (USD/tonne)  2021  693.
3 Brazil Producer Price (USD/tonne)  2022  854 

Para Tailandia

world_p1 %>% 
  filter(pais=="Thailand")
# A tibble: 3 × 4
  pais     usd_t                       year valor
  <chr>    <chr>                      <dbl> <dbl>
1 Thailand Producer Price (USD/tonne)  2020 1433.
2 Thailand Producer Price (USD/tonne)  2021 1625.
3 Thailand Producer Price (USD/tonne)  2022 1474.

promedio del valor por la tonelada recibida por algunos paises productores

worldv_vB <- world_p1 %>% 
  filter(pais=="Brazil") %>% 
  group_by(year) %>% 
  summarise(valor_anual_usd = sum(valor)) %>% 
  ggplot(aes(x=year, y=valor_anual_usd))+
    geom_line(color="#69b3a2") +
    geom_point(color="#69b3a2", size=2) +
    geom_text(aes(label=valor_anual_usd), vjust = -0.5, size=1.8)+
    labs( x= "año",
        y = "valor producción anual USD",
        title = "valor en USD por tonelada anual",
        subtitle = "Brazil"
        )
worldv_vB

Visualicemos

worldv_v2 <- world_p1%>%
  filter(!is.na(valor)) %>% 
  filter(year=="2022") %>% 
    ggplot( aes(x=reorder(pais, valor), y=valor) ) +
    geom_bar(stat="identity", fill="#69b3a2") +
    coord_flip() +
      theme(
      panel.grid.minor.y = element_blank(),
      panel.grid.major.y = element_blank(),
      legend.position="none"
    ) +
    xlab("") +
    ylab("Valor en USD por tonelada de latex para el año 2022")
worldv_v2

Existe una diferenciación entre los valores pagados por tonelada para los paises que registran ventas anuales por tonelada. Para Sri Lanka el valor por tonelada sobrepasa los 1500 dolares, mientras que México solo alcanza los 500 dolares

Balance Comercial para Colombia

Importación y exportación de caucho para Colombia

caucho_impo_expo <- read_csv("datos_caucho/datos_colombia/FAOSTAT_impor_expor_colombia.csv")
Rows: 22 Columns: 15
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (9): Domain Code, Domain, Area, Element, Item Code (CPC), Item, Unit, Fl...
dbl (5): Area Code (M49), Element Code, Year Code, Year, Value
lgl (1): Note

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
caucho_impo_expo %>% 
  head()
# A tibble: 6 × 15
  `Domain Code` Domain            `Area Code (M49)` Area  `Element Code` Element
  <chr>         <chr>                         <dbl> <chr>          <dbl> <chr>  
1 TCL           Crops and livest…               170 Colo…           5622 Import…
2 TCL           Crops and livest…               170 Colo…           5922 Export…
3 TCL           Crops and livest…               170 Colo…           5622 Import…
4 TCL           Crops and livest…               170 Colo…           5922 Export…
5 TCL           Crops and livest…               170 Colo…           5622 Import…
6 TCL           Crops and livest…               170 Colo…           5922 Export…
# ℹ 9 more variables: `Item Code (CPC)` <chr>, Item <chr>, `Year Code` <dbl>,
#   Year <dbl>, Unit <chr>, Value <dbl>, Flag <chr>, `Flag Description` <chr>,
#   Note <lgl>
glimpse(caucho_impo_expo)  
Rows: 22
Columns: 15
$ `Domain Code`      <chr> "TCL", "TCL", "TCL", "TCL", "TCL", "TCL", "TCL", "T…
$ Domain             <chr> "Crops and livestock products", "Crops and livestoc…
$ `Area Code (M49)`  <dbl> 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 1…
$ Area               <chr> "Colombia", "Colombia", "Colombia", "Colombia", "Co…
$ `Element Code`     <dbl> 5622, 5922, 5622, 5922, 5622, 5922, 5622, 5922, 562…
$ Element            <chr> "Import Value", "Export Value", "Import Value", "Ex…
$ `Item Code (CPC)`  <chr> "01950.01", "01950.01", "01950.01", "01950.01", "01…
$ Item               <chr> "Natural rubber in primary forms", "Natural rubber …
$ `Year Code`        <dbl> 2012, 2012, 2013, 2013, 2014, 2014, 2015, 2015, 201…
$ Year               <dbl> 2012, 2012, 2013, 2013, 2014, 2014, 2015, 2015, 201…
$ Unit               <chr> "1000 USD", "1000 USD", "1000 USD", "1000 USD", "10…
$ Value              <dbl> 25280, 56, 19158, 31, 21306, 25, 18293, 36, 11944, …
$ Flag               <chr> "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "…
$ `Flag Description` <chr> "Official figure", "Official figure", "Official fig…
$ Note               <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
                                                                                    *Las variables de interés tienen un tipo de dato que corresponde a su naturaleza*
                                                                                   
                                                                                   
summary(caucho_impo_expo)
 Domain Code           Domain          Area Code (M49)     Area          
 Length:22          Length:22          Min.   :170     Length:22         
 Class :character   Class :character   1st Qu.:170     Class :character  
 Mode  :character   Mode  :character   Median :170     Mode  :character  
                                       Mean   :170                       
                                       3rd Qu.:170                       
                                       Max.   :170                       
  Element Code    Element          Item Code (CPC)        Item          
 Min.   :5622   Length:22          Length:22          Length:22         
 1st Qu.:5622   Class :character   Class :character   Class :character  
 Median :5772   Mode  :character   Mode  :character   Mode  :character  
 Mean   :5772                                                           
 3rd Qu.:5922                                                           
 Max.   :5922                                                           
   Year Code         Year          Unit               Value        
 Min.   :2012   Min.   :2012   Length:22          Min.   :    9.0  
 1st Qu.:2014   1st Qu.:2014   Class :character   1st Qu.:  157.5  
 Median :2017   Median :2017   Mode  :character   Median : 5664.0  
 Mean   :2017   Mean   :2017                      Mean   : 8395.0  
 3rd Qu.:2020   3rd Qu.:2020                      3rd Qu.:16062.2  
 Max.   :2022   Max.   :2022                      Max.   :25280.0  
     Flag           Flag Description     Note        
 Length:22          Length:22          Mode:logical  
 Class :character   Class :character   NA's:22       
 Mode  :character   Mode  :character                 
                                                     
                                                     
                                                     
unique(caucho_impo_expo$Element)
[1] "Import Value" "Export Value"
                                                                                  **Limpieza**
                                                                                  
caucho_impo_expo2 <- caucho_impo_expo %>% 
  select(Element,Year,Unit, Value) %>% 
  clean_names() %>% 
  rename(
    tipo_transaccion=element,
    valor_USD=value
  )
caucho_impo_expo2
# A tibble: 22 × 4
   tipo_transaccion  year unit     valor_USD
   <chr>            <dbl> <chr>        <dbl>
 1 Import Value      2012 1000 USD     25280
 2 Export Value      2012 1000 USD        56
 3 Import Value      2013 1000 USD     19158
 4 Export Value      2013 1000 USD        31
 5 Import Value      2014 1000 USD     21306
 6 Export Value      2014 1000 USD        25
 7 Import Value      2015 1000 USD     18293
 8 Export Value      2015 1000 USD        36
 9 Import Value      2016 1000 USD     11944
10 Export Value      2016 1000 USD        43
# ℹ 12 more rows

Importación

importaciones <- caucho_impo_expo2 %>% 
  filter(tipo_transaccion=="Import Value")
importaciones
# A tibble: 11 × 4
   tipo_transaccion  year unit     valor_USD
   <chr>            <dbl> <chr>        <dbl>
 1 Import Value      2012 1000 USD     25280
 2 Import Value      2013 1000 USD     19158
 3 Import Value      2014 1000 USD     21306
 4 Import Value      2015 1000 USD     18293
 5 Import Value      2016 1000 USD     11944
 6 Import Value      2017 1000 USD     14722
 7 Import Value      2018 1000 USD     13147
 8 Import Value      2019 1000 USD     10005
 9 Import Value      2020 1000 USD     10698
10 Import Value      2021 1000 USD     16509
11 Import Value      2022 1000 USD     19613
                                                                                  **Exportaciones**
                                                                                  
exportaciones <- caucho_impo_expo2 %>% 
  filter(tipo_transaccion=="Export Value")
exportaciones
# A tibble: 11 × 4
   tipo_transaccion  year unit     valor_USD
   <chr>            <dbl> <chr>        <dbl>
 1 Export Value      2012 1000 USD        56
 2 Export Value      2013 1000 USD        31
 3 Export Value      2014 1000 USD        25
 4 Export Value      2015 1000 USD        36
 5 Export Value      2016 1000 USD        43
 6 Export Value      2017 1000 USD         9
 7 Export Value      2018 1000 USD       462
 8 Export Value      2019 1000 USD       483
 9 Export Value      2020 1000 USD       867
10 Export Value      2021 1000 USD       680
11 Export Value      2022 1000 USD      1323

La balanza comercial entre las importaciones y exportaciones del caucho natural en estado primario es deficitaria. Ya que casi se importa hasta 18 veces más de lo que se exporta