en este cuaderno se presenta el area que contiene el municipio Inirida y los 8 corregimientos del departamento de Guainia, los datos fueron tomados del DANE y de del EVA, se mostrata la distribucion de los mejores cultivos de Guainia, los library(ggplot2)cuales son la Yuca y el Patano.
library(sf)
## Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.3 v purrr 0.3.4
## v tibble 3.1.0 v dplyr 1.0.5
## v tidyr 1.1.3 v stringr 1.4.0
## v readr 1.4.0 v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(dplyr)
cultivos<- read.table(file = "Evaluaciones_Agropecuarias_Municipales_EVA.csv",header = T, sep = ";")
eva_guainia <- filter(cultivos, DEPARTAMENTO == "GUAINIA")
se modifican los encabezados para poder manejar mejor la informacion
names(eva_guainia)<- c("ID","Departamentos","CA_Municipio","Municipio","Grupo_de_cultivo","subgrupo_de_cultivo","Cultivo","Desagregacia regional y/o sistema productivo","Ano","Periodo","Area_cultivadas_ha","Area cosechada","Produccion_T","Rendimiento","Estado_fisico poduccion","Nombre_cientifico","ciclo_de_cultivo")
head(eva_guainia)
## ID Departamentos CA_Municipio Municipio Grupo_de_cultivo subgrupo_de_cultivo
## 1 94 GUAINIA 94001 INIRIDA FRUTALES AGUACATE
## 2 94 GUAINIA 94001 INIRIDA FRUTALES AGUACATE
## 3 94 GUAINIA 94001 INIRIDA FRUTALES AGUACATE
## 4 94 GUAINIA 94001 INIRIDA HORTALIZAS AHUYAMA
## 5 94 GUAINIA 94001 INIRIDA HORTALIZAS AHUYAMA
## 6 94 GUAINIA 94001 INIRIDA HORTALIZAS AHUYAMA
## Cultivo Desagregacia regional y/o sistema productivo Ano Periodo
## 1 AGUACATE AGUACATE 2014 2014
## 2 AGUACATE AGUACATE 2015 2015
## 3 AGUACATE AGUACATE 2016 2016
## 4 AHUYAMA AHUYAMA 2014 2014A
## 5 AHUYAMA AHUYAMA 2014 2014B
## 6 AHUYAMA AHUYAMA 2015 2015A
## Area_cultivadas_ha Area cosechada Produccion_T Rendimiento
## 1 1 0 0
## 2 1 1 1 1,5
## 3 1 1 1 1,5
## 4 3 2 30 13,2
## 5 2 1 12 12
## 6 3 3 42 13,2
## Estado_fisico poduccion Nombre_cientifico ciclo_de_cultivo
## 1 FRUTO FRESCO PERSEA AMERICANA MILL. PERMANENTE
## 2 FRUTO FRESCO PERSEA AMERICANA MILL. PERMANENTE
## 3 FRUTO FRESCO PERSEA AMERICANA MILL. PERMANENTE
## 4 HORTALIZA FRESCA CUCURBITA MOSHATA TRANSITORIO
## 5 HORTALIZA FRESCA CUCURBITA MOSHATA TRANSITORIO
## 6 HORTALIZA FRESCA CUCURBITA MOSHATA TRANSITORIO
tail(eva_guainia)
## ID Departamentos CA_Municipio Municipio Grupo_de_cultivo
## 157 94 GUAINIA 94343 BARRANCO MINA TUBERCULOS Y PLATANOS
## 158 94 GUAINIA 94886 CACAHUAL TUBERCULOS Y PLATANOS
## 159 94 GUAINIA 94883 SAN FELIPE TUBERCULOS Y PLATANOS
## 160 94 GUAINIA 94001 INIRIDA TUBERCULOS Y PLATANOS
## 161 94 GUAINIA 94888 MORICHAL TUBERCULOS Y PLATANOS
## 162 94 GUAINIA 94888 MORICHAL TUBERCULOS Y PLATANOS
## subgrupo_de_cultivo Cultivo Desagregacia regional y/o sistema productivo
## 157 YUCA YUCA YUCA INDUSTRIAL
## 158 YUCA YUCA YUCA INDUSTRIAL
## 159 YUCA YUCA YUCA INDUSTRIAL
## 160 YUCA YUCA YUCA INDUSTRIAL
## 161 YUCA YUCA YUCA INDUSTRIAL
## 162 YUCA YUCA YUCA INDUSTRIAL
## Ano Periodo Area_cultivadas_ha Area cosechada Produccion_T Rendimiento
## 157 2016 2016 658 658 6583 10
## 158 2016 2016 226 220 22 10
## 159 2016 2016 69 69 685 10
## 160 2016 2016 38 38 764 20
## 161 2017 2017 120 120 12 10
## 162 2018 2018 100 100 1 10
## Estado_fisico poduccion Nombre_cientifico ciclo_de_cultivo
## 157 TUBERCULO FRESCO MANIHOT ESCULENTA ANUAL
## 158 TUBERCULO FRESCO MANIHOT ESCULENTA ANUAL
## 159 TUBERCULO FRESCO MANIHOT ESCULENTA ANUAL
## 160 TUBERCULO FRESCO MANIHOT ESCULENTA ANUAL
## 161 TUBERCULO FRESCO MANIHOT ESCULENTA ANUAL
## 162 TUBERCULO FRESCO MANIHOT ESCULENTA ANUAL
se ingresas el shp. de Guainia, proporcionado por el DANE
muni_guainia<- sf::read_sf ("94_GUAINIA/ADMINISTRATIVO/MGN_MPIO_POLITICO.shp")
muni_guainia
## Simple feature collection with 9 features and 9 fields
## geometry type: POLYGON
## dimension: XY
## bbox: xmin: -70.94249 ymin: 1.165633 xmax: -66.84722 ymax: 4.045026
## geographic CRS: WGS 84
## # A tibble: 9 x 10
## DPTO_CCDGO MPIO_CCDGO MPIO_CNMBR MPIO_CRSLC MPIO_NAREA MPIO_NANO DPTO_CNMBR
## <chr> <chr> <chr> <chr> <dbl> <int> <chr>
## 1 94 94001 INÍRIDA Decreto 159~ 15970. 2017 GUAINÍA
## 2 94 94343 BARRANCO M~ Resolución ~ 9468. 2017 GUAINÍA
## 3 94 94663 MAPIRIPANA ACUERDO COM~ 4928. 2017 GUAINÍA
## 4 94 94883 SAN FELIPE Resolución ~ 2926. 2017 GUAINÍA
## 5 94 94884 PUERTO COL~ Resolución ~ 15701. 2017 GUAINÍA
## 6 94 94885 LA GUADALU~ Resolución ~ 1179. 2017 GUAINÍA
## 7 94 94886 CACAHUAL Resolución ~ 2335. 2017 GUAINÍA
## 8 94 94887 PANÁ-PANÁ ~ Resolución ~ 10227. 2017 GUAINÍA
## 9 94 94888 MORICHAL (~ 1988 8555. 2017 GUAINÍA
## # ... with 3 more variables: Shape_Leng <dbl>, Shape_Area <dbl>,
## # geometry <POLYGON [°]>
Generamos un nuevo encabezado llamdo Km2 trasformamos los datos a cordenadas liniales y los dovidimos por 1E6 para que nos de los Km2
muni_guainia$km2 <- st_area(st_transform(muni_guainia,3116))/1E6
pasamos los datos de Km2 a numericos para su posterior utilizacion
muni_guainia$km2 <- as.numeric(muni_guainia$km2)
muni_guainia$km2<- round(muni_guainia$km2)
Buscamos la minima extencion de terreno entre el municipio y los corregimientos
min(muni_guainia$km2)
## [1] 1179
buscamos el maxima extencion de los corregimientos y departamento
max(muni_guainia$km2)
## [1] 15970
identificamos los municipos y corregimientos
muni_guainia$MPIO_CNMBR
## [1] "INÍRIDA" "BARRANCO MINA"
## [3] "MAPIRIPANA" "SAN FELIPE"
## [5] "PUERTO COLOMBIA" "LA GUADALUPE"
## [7] "CACAHUAL" "PANÁ-PANÁ (Campo Alegre)"
## [9] "MORICHAL (Morichal Nuevo)"
Generamos el mapa de extencion deel corregimiento y municipios de Guainia
library(leaflet)
bins<- c(1050,3050,5050,7050,9050,11050,13050,15050,17050)
pal <- colorBin("YlOrRd", domain = muni_guainia$km2, bins = bins)
map<-leaflet(data = muni_guainia)%>%
addTiles()%>%
addPolygons(label = ~MPIO_CNMBR,
popup = ~km2,
fillColor = ~ pal(km2),
color="#444444",
weight = 1,
smoothFactor = 0.5,
opacity = 1.0,
fillOpacity = 0.5,
highlightOptions = highlightOptions(color = "red",weight =2,bringToFront = TRUE )
)%>%
addProviderTiles(providers$OpenStreetMap)%>%
addLegend("bottomright", pal= pal, values = ~km2,
title = "Extencion de los municipios [km2](DANE,2018)",opacity = 1)
map
sessionInfo()
## R version 4.0.4 (2021-02-15)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19042)
##
## Matrix products: default
##
## locale:
## [1] LC_COLLATE=Spanish_Colombia.1252 LC_CTYPE=Spanish_Colombia.1252
## [3] LC_MONETARY=Spanish_Colombia.1252 LC_NUMERIC=C
## [5] LC_TIME=Spanish_Colombia.1252
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] leaflet_2.0.4.1 forcats_0.5.1 stringr_1.4.0 dplyr_1.0.5
## [5] purrr_0.3.4 readr_1.4.0 tidyr_1.1.3 tibble_3.1.0
## [9] ggplot2_3.3.3 tidyverse_1.3.0 sf_0.9-7
##
## loaded via a namespace (and not attached):
## [1] Rcpp_1.0.6 lubridate_1.7.10 leaflet.providers_1.9.0
## [4] class_7.3-18 assertthat_0.2.1 digest_0.6.27
## [7] utf8_1.1.4 R6_2.5.0 cellranger_1.1.0
## [10] backports_1.2.1 reprex_1.0.0 evaluate_0.14
## [13] e1071_1.7-5 httr_1.4.2 pillar_1.5.1
## [16] rlang_0.4.10 readxl_1.3.1 rstudioapi_0.13
## [19] rmarkdown_2.7 htmlwidgets_1.5.3 munsell_0.5.0
## [22] proxy_0.4-25 broom_0.7.5 compiler_4.0.4
## [25] modelr_0.1.8 xfun_0.22 pkgconfig_2.0.3
## [28] htmltools_0.5.1.1 tidyselect_1.1.0 fansi_0.4.2
## [31] crayon_1.4.1 dbplyr_2.1.0 withr_2.4.1
## [34] grid_4.0.4 jsonlite_1.7.2 gtable_0.3.0
## [37] lifecycle_1.0.0 DBI_1.1.1 magrittr_2.0.1
## [40] units_0.7-0 scales_1.1.1 KernSmooth_2.23-18
## [43] cli_2.3.1 stringi_1.5.3 farver_2.1.0
## [46] fs_1.5.0 xml2_1.3.2 ellipsis_0.3.1
## [49] generics_0.1.0 vctrs_0.3.6 RColorBrewer_1.1-2
## [52] tools_4.0.4 glue_1.4.2 hms_1.0.0
## [55] crosstalk_1.1.1 yaml_2.2.1 colorspace_2.0-0
## [58] classInt_0.4-3 rvest_1.0.0 knitr_1.31
## [61] haven_2.3.1