library(ggplot2)
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 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
## v purrr 0.3.4
## -- 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")
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
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 [°]>
class(muni_guainia$MPIO_CCDGO)
## [1] "character"
head(muni_guainia$MPIO_CCDGO)
## [1] "94001" "94343" "94663" "94883" "94884" "94885"
class(eva_guainia$CA_Municipio)
## [1] "integer"
muni_guainia$COD_MUN <- as.double(muni_guainia$MPIO_CCDGO)
class(muni_guainia$COD_MUN)
## [1] "numeric"
head(muni_guainia$COD_MUN)
## [1] 94001 94343 94663 94883 94884 94885
eva_guainia$COD_MUN<-as.double(eva_guainia$CA_Municipio)
class(eva_guainia$COD_MUN)
## [1] "numeric"
head(eva_guainia$COD_MUN)
## [1] 94001 94001 94001 94001 94001 94001
###platano el platano es uno de los productos que hacen parte de la categoria tuberculos y platano se identificara la produccion en toneladas en el año 2016 y 2010, para hacer una comparacion con la Yuca
platano_gaui <- eva_guainia %>% filter(Cultivo =="PLATANO")%>%
dplyr::select(Municipio , COD_MUN , Ano , Periodo , Produccion_T, Rendimiento )
platano_gaui
## Municipio COD_MUN Ano Periodo Produccion_T Rendimiento
## 1 INIRIDA 94001 2007 2007 975 7,5
## 2 INIRIDA 94001 2008 2008 1125 7,5
## 3 INIRIDA 94001 2009 2009 1688 9,38
## 4 INIRIDA 94001 201 2010 1936 8,68
## 5 INIRIDA 94001 2011 2011 143 6,5
## 6 INIRIDA 94001 2012 2012 1945 6,8
## 7 INIRIDA 94001 2013 2013 2176 6,8
## 8 INIRIDA 94001 2014 2014 32 10
## 9 BARRANCO MINA 94343 2014 2014 104 8
## 10 INIRIDA 94001 2015 2015 32 10
## 11 BARRANCO MINA 94343 2015 2015 240 8
## 12 BARRANCO MINA 94343 2016 2016 823 7
## 13 INIRIDA 94001 2016 2016 847 7
## 14 SAN FELIPE 94883 2016 2016 28 7
## 15 BARRANCO MINA 94343 2017 2017 2044 7
## 16 INIRIDA 94001 2017 2017 102 5
## 17 MORICHAL 94888 2017 2017 39 7
## 18 SAN FELIPE 94883 2017 2017 35 7
## 19 BARRANCO MINA 94343 2018 2018 2009 7
## 20 INIRIDA 94001 2018 2018 102 5
## 21 MORICHAL 94888 2018 2018 25 7
## 22 SAN FELIPE 94883 2018 2018 21 7
unique(platano_gaui$Ano)
## [1] 2007 2008 2009 201 2011 2012 2013 2014 2015 2016 2017 2018
###convertyir de formato largo a ancho se pasara de formato para poder incertarlo con las otras tablas
platano_gaui$Produccion_T<- as.numeric(platano_gaui$Produccion_T)
platano_gaui%>% replace(is.na(.),0)-> platano_gaui2
platano_gaui %>%
group_by( Municipio ,COD_MUN, Ano) %>%
summarise(Produccion_T=sum(Produccion_T))->platano_gaui2
## `summarise()` has grouped output by 'Municipio', 'COD_MUN'. You can override using the `.groups` argument.
head(platano_gaui2)
## # A tibble: 6 x 4
## # Groups: Municipio, COD_MUN [2]
## Municipio COD_MUN Ano Produccion_T
## <chr> <dbl> <int> <dbl>
## 1 BARRANCO MINA 94343 2014 104
## 2 BARRANCO MINA 94343 2015 240
## 3 BARRANCO MINA 94343 2016 823
## 4 BARRANCO MINA 94343 2017 2044
## 5 BARRANCO MINA 94343 2018 2009
## 6 INIRIDA 94001 201 1936
se reunen los datos de las dos temporadas del año A y B e una sola tabla, este permite manejar mejor los datos de toneladas
platano_gaui2 %>%
group_by(COD_MUN)%>%
gather("Produccion_T", key = variable, value = numero) %>%
unite(combi,variable,Ano)%>%
pivot_wider(names_from = combi, values_from = numero, values_fill = 0)->
platano_gaui3
platano_gaui3
## # A tibble: 4 x 14
## # Groups: COD_MUN [4]
## Municipio COD_MUN Produccion_T_2014 Produccion_T_2015 Produccion_T_2016
## <chr> <dbl> <dbl> <dbl> <dbl>
## 1 BARRANCO MINA 94343 104 240 823
## 2 INIRIDA 94001 32 32 847
## 3 MORICHAL 94888 0 0 0
## 4 SAN FELIPE 94883 0 0 28
## # ... with 9 more variables: Produccion_T_2017 <dbl>, Produccion_T_2018 <dbl>,
## # Produccion_T_201 <dbl>, Produccion_T_2007 <dbl>, Produccion_T_2008 <dbl>,
## # Produccion_T_2009 <dbl>, Produccion_T_2011 <dbl>, Produccion_T_2012 <dbl>,
## # Produccion_T_2013 <dbl>
mun_platano_gaui<- left_join( muni_guainia , platano_gaui3 , by ="COD_MUN")
summary(mun_platano_gaui)
## DPTO_CCDGO MPIO_CCDGO MPIO_CNMBR MPIO_CRSLC
## Length:9 Length:9 Length:9 Length:9
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## MPIO_NAREA MPIO_NANO DPTO_CNMBR Shape_Leng
## Min. : 1179 Min. :2017 Length:9 Min. :1.751
## 1st Qu.: 2926 1st Qu.:2017 Class :character 1st Qu.:4.030
## Median : 8555 Median :2017 Mode :character Median :6.826
## Mean : 7921 Mean :2017 Mean :5.903
## 3rd Qu.:10227 3rd Qu.:2017 3rd Qu.:7.805
## Max. :15970 Max. :2017 Max. :9.257
##
## Shape_Area geometry COD_MUN Municipio
## Min. :0.09434 POLYGON :9 Min. :94001 Length:9
## 1st Qu.:0.23461 epsg:4326 :0 1st Qu.:94663 Class :character
## Median :0.69179 +proj=long...:0 Median :94884 Mode :character
## Mean :0.63866 Mean :94702
## 3rd Qu.:0.82504 3rd Qu.:94886
## Max. :1.28699 Max. :94888
##
## Produccion_T_2014 Produccion_T_2015 Produccion_T_2016 Produccion_T_2017
## Min. : 0 Min. : 0 Min. : 0.0 Min. : 35.0
## 1st Qu.: 0 1st Qu.: 0 1st Qu.: 21.0 1st Qu.: 38.0
## Median : 16 Median : 16 Median :425.5 Median : 70.5
## Mean : 34 Mean : 68 Mean :424.5 Mean : 555.0
## 3rd Qu.: 50 3rd Qu.: 84 3rd Qu.:829.0 3rd Qu.: 587.5
## Max. :104 Max. :240 Max. :847.0 Max. :2044.0
## NA's :5 NA's :5 NA's :5 NA's :5
## Produccion_T_2018 Produccion_T_201 Produccion_T_2007 Produccion_T_2008
## Min. : 21.0 Min. : 0 Min. : 0.0 Min. : 0.0
## 1st Qu.: 24.0 1st Qu.: 0 1st Qu.: 0.0 1st Qu.: 0.0
## Median : 63.5 Median : 0 Median : 0.0 Median : 0.0
## Mean : 539.2 Mean : 484 Mean :243.8 Mean : 281.2
## 3rd Qu.: 578.8 3rd Qu.: 484 3rd Qu.:243.8 3rd Qu.: 281.2
## Max. :2009.0 Max. :1936 Max. :975.0 Max. :1125.0
## NA's :5 NA's :5 NA's :5 NA's :5
## Produccion_T_2009 Produccion_T_2011 Produccion_T_2012 Produccion_T_2013
## Min. : 0 Min. : 0.00 Min. : 0.0 Min. : 0
## 1st Qu.: 0 1st Qu.: 0.00 1st Qu.: 0.0 1st Qu.: 0
## Median : 0 Median : 0.00 Median : 0.0 Median : 0
## Mean : 422 Mean : 35.75 Mean : 486.2 Mean : 544
## 3rd Qu.: 422 3rd Qu.: 35.75 3rd Qu.: 486.2 3rd Qu.: 544
## Max. :1688 Max. :143.00 Max. :1945.0 Max. :2176
## NA's :5 NA's :5 NA's :5 NA's :5
mapa de la produccion en toneladas de platano en el año 2016
library(leaflet)
bins<- c(0,106,212,318,424,530,636,742,848)
pal <- colorBin("YlOrRd", domain = mun_platano_gaui$Produccion_T_2016, bins = bins)
map<-leaflet(data = mun_platano_gaui)%>%
addTiles()%>%
addPolygons(label = ~Produccion_T_2016,
popup = ~MPIO_CNMBR,
fillColor = ~ pal(Produccion_T_2016),
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 = ~Produccion_T_2016,
title = "Produccion en Toneladas de platano 2016 [Ton](DANE,2018)",opacity = 1)
map
mapa de la produccion de Platano en el año 2010
library(leaflet)
bins<- c(0,243,486,729,972,1215,1458,1701,1944)
pal <- colorBin("YlOrRd", domain = mun_platano_gaui$Produccion_T_201, bins = bins)
map<-leaflet(data = mun_platano_gaui)%>%
addTiles()%>%
addPolygons(label = ~Produccion_T_201,
popup = ~MPIO_CNMBR,
fillColor = ~ pal(Produccion_T_201),
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 = ~Produccion_T_201,
title = "Produccion en Toneladas de platano 2010 [Ton](DANE,2018)",opacity = 1)
map
###Area de siembra de la Platano en tes parte identificaremos las hectarias cultivadas en estos dos años, es importante resaltar que en berificaremos si la productividad es buena.
platano_gaui_hasem <- eva_guainia %>% filter(Cultivo =="PLATANO")%>%
dplyr::select(Municipio , COD_MUN , Ano , Periodo , Produccion_T, Rendimiento,Area_cultivadas_ha)
platano_gaui_hasem
## Municipio COD_MUN Ano Periodo Produccion_T Rendimiento
## 1 INIRIDA 94001 2007 2007 975 7,5
## 2 INIRIDA 94001 2008 2008 1125 7,5
## 3 INIRIDA 94001 2009 2009 1688 9,38
## 4 INIRIDA 94001 201 2010 1936 8,68
## 5 INIRIDA 94001 2011 2011 143 6,5
## 6 INIRIDA 94001 2012 2012 1945 6,8
## 7 INIRIDA 94001 2013 2013 2176 6,8
## 8 INIRIDA 94001 2014 2014 32 10
## 9 BARRANCO MINA 94343 2014 2014 104 8
## 10 INIRIDA 94001 2015 2015 32 10
## 11 BARRANCO MINA 94343 2015 2015 240 8
## 12 BARRANCO MINA 94343 2016 2016 823 7
## 13 INIRIDA 94001 2016 2016 847 7
## 14 SAN FELIPE 94883 2016 2016 28 7
## 15 BARRANCO MINA 94343 2017 2017 2044 7
## 16 INIRIDA 94001 2017 2017 102 5
## 17 MORICHAL 94888 2017 2017 39 7
## 18 SAN FELIPE 94883 2017 2017 35 7
## 19 BARRANCO MINA 94343 2018 2018 2009 7
## 20 INIRIDA 94001 2018 2018 102 5
## 21 MORICHAL 94888 2018 2018 25 7
## 22 SAN FELIPE 94883 2018 2018 21 7
## Area_cultivadas_ha
## 1 250
## 2 390
## 3 368
## 4 815
## 5 479
## 6 519
## 7 115
## 8 320
## 9 130
## 10 345
## 11 130
## 12 294
## 13 121
## 14 4
## 15 294
## 16 244
## 17 6
## 18 5
## 19 294
## 20 239
## 21 8
## 22 7
unique(platano_gaui_hasem $Ano)
## [1] 2007 2008 2009 201 2011 2012 2013 2014 2015 2016 2017 2018
platano_gaui_hasem$Area_cultivadas_ha<- as.numeric(platano_gaui_hasem$Area_cultivadas_ha)
platano_gaui_hasem %>% replace ( is.na (.) ,0 ) -> platano_gaui_hasem2
platano_gaui_hasem %>%
group_by( Municipio,COD_MUN,Ano) %>%
summarise(Area_cultivadas_ha=sum(Area_cultivadas_ha))->platano_gaui_hasem2
## `summarise()` has grouped output by 'Municipio', 'COD_MUN'. You can override using the `.groups` argument.
head(platano_gaui_hasem2)
## # A tibble: 6 x 4
## # Groups: Municipio, COD_MUN [2]
## Municipio COD_MUN Ano Area_cultivadas_ha
## <chr> <dbl> <int> <dbl>
## 1 BARRANCO MINA 94343 2014 130
## 2 BARRANCO MINA 94343 2015 130
## 3 BARRANCO MINA 94343 2016 294
## 4 BARRANCO MINA 94343 2017 294
## 5 BARRANCO MINA 94343 2018 294
## 6 INIRIDA 94001 201 815
platano_gaui_hasem2 %>%
group_by(COD_MUN)%>%
gather("Area_cultivadas_ha", key = variable, value = numero) %>%
unite(combi,variable,Ano)%>%
pivot_wider(names_from = combi, values_from = numero, values_fill = 0)->
platano_gaui_hasem3
platano_gaui_hasem3
## # A tibble: 4 x 14
## # Groups: COD_MUN [4]
## Municipio COD_MUN Area_cultivadas_ha~ Area_cultivadas_ha~ Area_cultivadas_h~
## <chr> <dbl> <dbl> <dbl> <dbl>
## 1 BARRANCO M~ 94343 130 130 294
## 2 INIRIDA 94001 320 345 121
## 3 MORICHAL 94888 0 0 0
## 4 SAN FELIPE 94883 0 0 4
## # ... with 9 more variables: Area_cultivadas_ha_2017 <dbl>,
## # Area_cultivadas_ha_2018 <dbl>, Area_cultivadas_ha_201 <dbl>,
## # Area_cultivadas_ha_2007 <dbl>, Area_cultivadas_ha_2008 <dbl>,
## # Area_cultivadas_ha_2009 <dbl>, Area_cultivadas_ha_2011 <dbl>,
## # Area_cultivadas_ha_2012 <dbl>, Area_cultivadas_ha_2013 <dbl>
mun_platano_gaui_hasem<- left_join( muni_guainia ,platano_gaui_hasem3 , by ="COD_MUN")
summary(mun_platano_gaui_hasem)
## DPTO_CCDGO MPIO_CCDGO MPIO_CNMBR MPIO_CRSLC
## Length:9 Length:9 Length:9 Length:9
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## MPIO_NAREA MPIO_NANO DPTO_CNMBR Shape_Leng
## Min. : 1179 Min. :2017 Length:9 Min. :1.751
## 1st Qu.: 2926 1st Qu.:2017 Class :character 1st Qu.:4.030
## Median : 8555 Median :2017 Mode :character Median :6.826
## Mean : 7921 Mean :2017 Mean :5.903
## 3rd Qu.:10227 3rd Qu.:2017 3rd Qu.:7.805
## Max. :15970 Max. :2017 Max. :9.257
##
## Shape_Area geometry COD_MUN Municipio
## Min. :0.09434 POLYGON :9 Min. :94001 Length:9
## 1st Qu.:0.23461 epsg:4326 :0 1st Qu.:94663 Class :character
## Median :0.69179 +proj=long...:0 Median :94884 Mode :character
## Mean :0.63866 Mean :94702
## 3rd Qu.:0.82504 3rd Qu.:94886
## Max. :1.28699 Max. :94888
##
## Area_cultivadas_ha_2014 Area_cultivadas_ha_2015 Area_cultivadas_ha_2016
## Min. : 0.0 Min. : 0.0 Min. : 0.0
## 1st Qu.: 0.0 1st Qu.: 0.0 1st Qu.: 3.0
## Median : 65.0 Median : 65.0 Median : 62.5
## Mean :112.5 Mean :118.8 Mean :104.8
## 3rd Qu.:177.5 3rd Qu.:183.8 3rd Qu.:164.2
## Max. :320.0 Max. :345.0 Max. :294.0
## NA's :5 NA's :5 NA's :5
## Area_cultivadas_ha_2017 Area_cultivadas_ha_2018 Area_cultivadas_ha_201
## Min. : 5.00 Min. : 7.00 Min. : 0.0
## 1st Qu.: 5.75 1st Qu.: 7.75 1st Qu.: 0.0
## Median :125.00 Median :123.50 Median : 0.0
## Mean :137.25 Mean :137.00 Mean :203.8
## 3rd Qu.:256.50 3rd Qu.:252.75 3rd Qu.:203.8
## Max. :294.00 Max. :294.00 Max. :815.0
## NA's :5 NA's :5 NA's :5
## Area_cultivadas_ha_2007 Area_cultivadas_ha_2008 Area_cultivadas_ha_2009
## Min. : 0.0 Min. : 0.0 Min. : 0
## 1st Qu.: 0.0 1st Qu.: 0.0 1st Qu.: 0
## Median : 0.0 Median : 0.0 Median : 0
## Mean : 62.5 Mean : 97.5 Mean : 92
## 3rd Qu.: 62.5 3rd Qu.: 97.5 3rd Qu.: 92
## Max. :250.0 Max. :390.0 Max. :368
## NA's :5 NA's :5 NA's :5
## Area_cultivadas_ha_2011 Area_cultivadas_ha_2012 Area_cultivadas_ha_2013
## Min. : 0.0 Min. : 0.0 Min. : 0.00
## 1st Qu.: 0.0 1st Qu.: 0.0 1st Qu.: 0.00
## Median : 0.0 Median : 0.0 Median : 0.00
## Mean :119.8 Mean :129.8 Mean : 28.75
## 3rd Qu.:119.8 3rd Qu.:129.8 3rd Qu.: 28.75
## Max. :479.0 Max. :519.0 Max. :115.00
## NA's :5 NA's :5 NA's :5
mapa del area cosechada en el año 2016 del platano
library(leaflet)
bins<- c(0,37,74,111,148,185,222,259,296)
pal <- colorBin("YlOrRd", domain = mun_platano_gaui_hasem$Area_cultivadas_ha_2016, bins = bins)
map<-leaflet(data = mun_platano_gaui_hasem)%>%
addTiles()%>%
addPolygons(label = ~Area_cultivadas_ha_2016,
popup = ~MPIO_CNMBR,
fillColor = ~ pal(Area_cultivadas_ha_2016),
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 = ~Area_cultivadas_ha_2016,
title = "Area cultivadas de Platano 2016 [Ha](DANE,2018)",opacity = 1)
map
mapa del are cosechada del platano en el año 2010
library(leaflet)
bins<- c(0,102,204,306,408,510,612,714,816)
pal <- colorBin("YlOrRd", domain = mun_platano_gaui_hasem$Area_cultivadas_ha_201, bins = bins)
map<-leaflet(data = mun_platano_gaui_hasem)%>%
addTiles()%>%
addPolygons(label = ~Area_cultivadas_ha_201,
popup = ~MPIO_CNMBR,
fillColor = ~ pal(Area_cultivadas_ha_201),
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 = ~Area_cultivadas_ha_201,
title = "Area cultivadas de Platano 2010 [Ha](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] tidyverse_1.3.0 sf_0.9-7 ggplot2_3.3.3
##
## 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