Este es un R Markdown Notebook en el que se manejan funciones basicas de las bibliotecas “simple features” (sf) y “tidyverse” (tidyverse). Tiene como proposito responder a la actividad de aprendizaje de las funcionalidades geoespaciales R en la clase de geomática básica de la Universidad Nacional de Colombia. Antes de empezar es necesario tener instalados las bibliotecas necesarias.
#install.packages (c ("tidyverse", "sf"))
Una vez intaladas las bibliotecas es necesario cargarlas
library(tidyverse)
library(sf)
Primero leeremos un shapefile que representa a los departamentos colombianos que se que se puede descargar de DIVA-GIS en https://www.diva-gis.org/data
Cambiaremos el lugar de lectura de archivos a la carpeta donde puestos los archivos descargados, el nombre del archivo a leer es “COL_adm1.shp”
setwd("C:/Users/rojas/OneDrive/Escritorio/R estudio/Geomatica/Departamento/19_CAUCA")
The working directory was changed to C:/Users/rojas/OneDrive/Escritorio/R estudio/Geomatica/Departamento/19_CAUCA inside a notebook chunk. The working directory will be reset when the chunk is finished running. Use the knitr root.dir option in the setup chunk to change the working directory for notebook chunks.
deptos <- read_sf("COL_adm1.shp")
Para saber el contenido del objeto “deptos” pudemos hacer lo siguiente
head(deptos)
Simple feature collection with 6 features and 9 fields
geometry type: MULTIPOLYGON
dimension: XY
bbox: xmin: -77.149 ymin: -4.228429 xmax: -69.36835 ymax: 11.10792
geographic CRS: WGS 84
resulta útil observar las funciones básicas proporcionadas por la biblioteca sf. Por ejemplo, podemos usar la función “st_crs()” para saber cuál es el sistema de referencia de coordenadas de los datos vectoriales almacenados en el objeto “deptos”
st_crs(deptos)
Coordinate Reference System:
User input: WGS 84
wkt:
GEOGCRS["WGS 84",
DATUM["World Geodetic System 1984",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
CS[ellipsoidal,2],
AXIS["latitude",north,
ORDER[1],
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["longitude",east,
ORDER[2],
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4326]]
Para comprender los datos resulta muy util trazarlos. Para lo cual odemos utilizar las funcionalidades de ggplot:
ggplot() + geom_sf(data = deptos)
Es posible utilizar cualquier sistema de referencia de coordenadas para trazar los datos, aunque se debe tener cuidado pues hay sistemás de referencias de coordenadas que estan definidos explicitamente para un país o una región pues esto puede crear deformaciones. Puede encontrar más información sobre los códigos EPSG en https://epsg.io/
# El CRS 3978 es el sistemás de referencias de coordenadas usado en Canadá
ggplot() + geom_sf(data = deptos) + coord_sf(crs=st_crs(3978))
as propiedades del CRS con el código EPSG 32618. Corresponde a UTM 18 N. Por lo cual, en caso de requerir usar dicho CRS, es necesario convertir el objeto espacial de EPSG4326 a EPSG: 32618.Para ello realizamos lo siguiente
deptos_utm <- st_transform(deptos, crs = st_crs(32618))
deptos_utm
Simple feature collection with 32 features and 9 fields
geometry type: MULTIPOLYGON
dimension: XY
bbox: xmin: -245935.3 ymin: -469204.3 xmax: 1407491 ymax: 1763314
projected CRS: WGS 84 / UTM zone 18N
ggplot() + geom_sf(data = deptos_utm)
Como solo nos interesa un departamento que es Cauca vamos a realizar un filtro
cauca <- deptos %>% filter(NAME_1 == "Cauca")
trazamos el nuevo objeto
ggplot()+geom_sf(data=cauca)
Repetiremos los pasos anteriores para cargar los municipios colombianos y filtrar los del departamento de cauca en el archivo de nombre “COL_adm2.shp” que descargamos anteriormente
setwd("C:/Users/rojas/OneDrive/Escritorio/R estudio/Geomatica/Departamento/19_CAUCA")
The working directory was changed to C:/Users/rojas/OneDrive/Escritorio/R estudio/Geomatica/Departamento/19_CAUCA inside a notebook chunk. The working directory will be reset when the chunk is finished running. Use the knitr root.dir option in the setup chunk to change the working directory for notebook chunks.
munic <- read_sf("COL_adm2.shp")
mun_cauca <- munic %>% filter(NAME_1 == "Cauca")
ggplot() + geom_sf(data = mun_cauca)
mun_cauca
Simple feature collection with 38 features and 11 fields
geometry type: MULTIPOLYGON
dimension: XY
bbox: xmin: -78.02388 ymin: 0.953701 xmax: -75.8478 ymax: 3.316301
geographic CRS: WGS 84
Hora antes de hacer el plot le vamos a asignar un centroide acada poligono que representan a los municipios de Cauca para poder ponerles una etiqueta de ID a los municipios.
cauca_points<- st_centroid(mun_cauca)
st_centroid assumes attributes are constant over geometries of xst_centroid does not give correct centroids for longitude/latitude data
cauca_points <- cbind(mun_cauca, st_coordinates(st_centroid(mun_cauca$geometry)))
st_centroid does not give correct centroids for longitude/latitude data
ggplot(cauca) +
geom_sf(data=deptos) +
geom_sf(data = cauca_points, fill = "antiquewhite",) +
geom_text(data = cauca_points, aes(x=X, y=Y,label = ID_2), size = 2, ) +
coord_sf(xlim = c(-78.25, -75.65), ylim = c(0.75, 3.5), expand = FALSE)
library(scales)
Se puede hacer un mejor plot agregando “scale_fill_distiller” que nos permite ponerle un título y usar una paleta de colores para distinguir los ID por tamaño.
ggplot(cauca) +
geom_sf(data=cauca_points, aes(x=X, y=Y, fill =ID_2), color = "black", size = 0.25) + geom_text(data = cauca_points, aes(x=X, y=Y,label = ID_2), size = 2) +
theme(aspect.ratio=1)+
scale_fill_distiller(name="ID_2", palette = "YlOrBr", breaks = pretty_breaks(n =4))+labs(title="Municipios del departamento de Cauca")
Ignoring unknown aesthetics: x, y
Para más información sobre las paletas de colores en https://www.datanovia.com/en/blog/top-r-color-palettes-to-know-for-great-data-visualization/
Aunque la visualización aun no es un mapa real podemos guardarlo como pdf Desmencional el código para guardar.
#ggsave("cauca_municipios.pdf")
Otra opción para guardarlo es como un .png
#ggsave("map_cauca.png", width = 6, height = 6, dpi = "screen")
Para esto necesitamos instalar primero otra libreria y cargar la biblioteca:
#install.packages("leaflet")
library(leaflet)
Para utilizar esta biblioteca, necesitamos convertir de características simples a puntos espaciales de la siguiente manera.
cau_points <- as(cauca_points, 'Spatial')
ahora observaremos que hay dentro del objeto
head(cau_points)
An object of class "SpatialPolygonsDataFrame"
Slot "data":
Slot "polygons":
[[1]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -76.882724 1.908871
Slot "area":
[1] 0.0223311
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -76.7739 1.969300
[2,] -76.7796 1.954900
[3,] -76.7888 1.938201
[4,] -76.7981 1.925000
[5,] -76.8050 1.905400
[6,] -76.8176 1.889801
[7,] -76.8263 1.874800
[8,] -76.8401 1.854700
[9,] -76.8608 1.839200
[10,] -76.8764 1.825400
[11,] -76.8954 1.811600
[12,] -76.9127 1.794900
[13,] -76.9190 1.794900
[14,] -76.9248 1.801300
[15,] -76.9300 1.813500
[16,] -76.9369 1.826799
[17,] -76.9369 1.844100
[18,] -76.9387 1.864300
[19,] -76.9502 1.888600
[20,] -76.9658 1.903100
[21,] -76.9814 1.922300
[22,] -76.9866 1.929800
[23,] -76.9750 1.933800
[24,] -76.9554 1.952200
[25,] -76.9422 1.955600
[26,] -76.9307 1.971201
[27,] -76.9186 1.980901
[28,] -76.8978 1.983100
[29,] -76.8921 1.989500
[30,] -76.8834 1.989400
[31,] -76.8788 1.988800
[32,] -76.8552 1.981801
[33,] -76.8390 1.979401
[34,] -76.8206 1.975301
[35,] -76.8067 1.975301
[36,] -76.7935 1.972301
[37,] -76.7796 1.968801
[38,] -76.7739 1.969300
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -76.882724 1.908871
Slot "ID":
[1] "1"
Slot "area":
[1] 0.0223311
[[2]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -77.284239 2.274516
Slot "area":
[1] 0.03305874
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -77.37980 2.159601
[2,] -77.38100 2.165401
[3,] -77.38270 2.175199
[4,] -77.38210 2.184500
[5,] -77.38910 2.195500
[6,] -77.39770 2.209400
[7,] -77.40000 2.211700
[8,] -77.40700 2.213400
[9,] -77.40909 2.213420
[10,] -77.40870 2.218601
[11,] -77.38910 2.222601
[12,] -77.36200 2.226500
[13,] -77.34530 2.238001
[14,] -77.35220 2.275000
[15,] -77.34760 2.301600
[16,] -77.33780 2.313700
[17,] -77.33380 2.336200
[18,] -77.33900 2.344901
[19,] -77.33560 2.361601
[20,] -77.31770 2.371900
[21,] -77.32278 2.377899
[22,] -77.31710 2.388100
[23,] -77.31020 2.393800
[24,] -77.29410 2.397201
[25,] -77.27560 2.393700
[26,] -77.25600 2.387200
[27,] -77.23810 2.377901
[28,] -77.19610 2.369101
[29,] -77.17240 2.369600
[30,] -77.15740 2.358501
[31,] -77.17300 2.357400
[32,] -77.17880 2.343600
[33,] -77.17700 2.329700
[34,] -77.17240 2.302001
[35,] -77.17240 2.295100
[36,] -77.18790 2.292800
[37,] -77.20750 2.296401
[38,] -77.21100 2.296401
[39,] -77.20980 2.279600
[40,] -77.20460 2.265200
[41,] -77.21040 2.255901
[42,] -77.22080 2.245599
[43,] -77.23060 2.237000
[44,] -77.23110 2.230600
[45,] -77.22650 2.225400
[46,] -77.23000 2.224800
[47,] -77.24150 2.204700
[48,] -77.24780 2.193100
[49,] -77.25420 2.183299
[50,] -77.26800 2.175901
[51,] -77.28760 2.173700
[52,] -77.29510 2.173100
[53,] -77.29680 2.162700
[54,] -77.31580 2.155300
[55,] -77.33660 2.152501
[56,] -77.35270 2.142200
[57,] -77.36710 2.138200
[58,] -77.37290 2.138801
[59,] -77.37980 2.159601
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -77.284239 2.274516
Slot "ID":
[1] "2"
Slot "area":
[1] 0.03305874
[[3]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -77.227759 2.106755
Slot "area":
[1] 0.03457614
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -77.24387 1.964288
[2,] -77.24660 1.967301
[3,] -77.26730 1.985801
[4,] -77.27710 1.994601
[5,] -77.28750 2.009000
[6,] -77.29040 2.021200
[7,] -77.28930 2.036801
[8,] -77.29040 2.046601
[9,] -77.29040 2.066200
[10,] -77.29220 2.085900
[11,] -77.30430 2.108500
[12,] -77.31180 2.108500
[13,] -77.32330 2.108500
[14,] -77.32790 2.102800
[15,] -77.33140 2.095300
[16,] -77.33370 2.087801
[17,] -77.34120 2.084900
[18,] -77.35670 2.084401
[19,] -77.36360 2.089599
[20,] -77.36710 2.100099
[21,] -77.36770 2.107600
[22,] -77.37170 2.119101
[23,] -77.37290 2.138801
[24,] -77.36710 2.138200
[25,] -77.35270 2.142200
[26,] -77.33660 2.152501
[27,] -77.31580 2.155300
[28,] -77.29680 2.162700
[29,] -77.29510 2.173100
[30,] -77.28760 2.173700
[31,] -77.26800 2.175901
[32,] -77.25420 2.183299
[33,] -77.24780 2.193100
[34,] -77.24150 2.204700
[35,] -77.23000 2.224800
[36,] -77.22650 2.225400
[37,] -77.21900 2.229399
[38,] -77.21330 2.222400
[39,] -77.20920 2.213199
[40,] -77.19480 2.201601
[41,] -77.17410 2.195101
[42,] -77.15680 2.187001
[43,] -77.13310 2.170101
[44,] -77.11980 2.157901
[45,] -77.10660 2.149201
[46,] -77.10480 2.131301
[47,] -77.11170 2.112300
[48,] -77.12610 2.085201
[49,] -77.13360 2.073101
[50,] -77.14400 2.051800
[51,] -77.15490 2.040801
[52,] -77.17570 2.035101
[53,] -77.20510 2.032999
[54,] -77.21080 2.022000
[55,] -77.21600 2.010500
[56,] -77.22290 1.993700
[57,] -77.23220 1.983401
[58,] -77.23910 1.971301
[59,] -77.24387 1.964288
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -77.227759 2.106755
Slot "ID":
[1] "3"
Slot "area":
[1] 0.03457614
[[4]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -76.982924 1.846701
Slot "area":
[1] 0.07623461
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -76.91090 1.630800
[2,] -76.91490 1.633200
[3,] -76.92820 1.642499
[4,] -76.94370 1.650599
[5,] -76.95470 1.657601
[6,] -76.96620 1.664001
[7,] -76.98930 1.683701
[8,] -77.00950 1.698299
[9,] -77.01870 1.701800
[10,] -77.03600 1.714000
[11,] -77.04700 1.716300
[12,] -77.06140 1.715801
[13,] -77.06600 1.724500
[14,] -77.07230 1.738401
[15,] -77.07010 1.775899
[16,] -77.06260 1.786901
[17,] -77.04930 1.800101
[18,] -77.05850 1.818601
[19,] -77.07300 1.819301
[20,] -77.08680 1.823401
[21,] -77.10760 1.826899
[22,] -77.10580 1.847701
[23,] -77.10240 1.858101
[24,] -77.10180 1.871400
[25,] -77.10700 1.888101
[26,] -77.11340 1.898601
[27,] -77.12430 1.911900
[28,] -77.13410 1.927501
[29,] -77.14220 1.943199
[30,] -77.14340 1.956999
[31,] -77.15780 1.957100
[32,] -77.15490 1.967499
[33,] -77.13700 1.980101
[34,] -77.08980 2.004699
[35,] -77.06790 2.015001
[36,] -77.04200 2.034599
[37,] -77.01890 2.050701
[38,] -77.00680 2.076599
[39,] -76.99990 2.088100
[40,] -76.98610 2.113501
[41,] -76.97510 2.118601
[42,] -76.97230 2.120901
[43,] -76.96650 2.105300
[44,] -76.96470 2.093201
[45,] -76.96240 2.079300
[46,] -76.95200 2.071200
[47,] -76.93650 2.061901
[48,] -76.92670 2.053199
[49,] -76.91570 2.039201
[50,] -76.90360 2.022401
[51,] -76.89550 2.013201
[52,] -76.88690 2.001000
[53,] -76.88340 1.989400
[54,] -76.89210 1.989500
[55,] -76.89780 1.983100
[56,] -76.91860 1.980901
[57,] -76.93070 1.971201
[58,] -76.94220 1.955600
[59,] -76.95540 1.952200
[60,] -76.97500 1.933800
[61,] -76.98660 1.929800
[62,] -76.98140 1.922300
[63,] -76.96580 1.903100
[64,] -76.95020 1.888600
[65,] -76.93870 1.864300
[66,] -76.93690 1.844100
[67,] -76.93690 1.826799
[68,] -76.93000 1.813500
[69,] -76.92480 1.801300
[70,] -76.91900 1.794900
[71,] -76.91500 1.782800
[72,] -76.90750 1.771801
[73,] -76.89650 1.759601
[74,] -76.88210 1.758400
[75,] -76.86540 1.752499
[76,] -76.85270 1.751301
[77,] -76.84580 1.740901
[78,] -76.83080 1.737400
[79,] -76.82555 1.736315
[80,] -76.82100 1.719399
[81,] -76.82210 1.697499
[82,] -76.82270 1.677801
[83,] -76.82100 1.668600
[84,] -76.81810 1.646599
[85,] -76.82040 1.624701
[86,] -76.82440 1.613700
[87,] -76.82960 1.603401
[88,] -76.83650 1.596499
[89,] -76.85320 1.600600
[90,] -76.86470 1.606999
[91,] -76.88030 1.613401
[92,] -76.89470 1.622700
[93,] -76.91090 1.630800
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -76.982924 1.846701
Slot "ID":
[1] "4"
Slot "area":
[1] 0.07623461
[[5]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -76.703115 2.993272
Slot "area":
[1] 0.04552716
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -76.6372 2.872699
[2,] -76.6453 2.877401
[3,] -76.6539 2.877401
[4,] -76.6614 2.875701
[5,] -76.6660 2.871101
[6,] -76.6723 2.862500
[7,] -76.6746 2.857301
[8,] -76.6781 2.850999
[9,] -76.6810 2.846400
[10,] -76.6844 2.838300
[11,] -76.6890 2.831401
[12,] -76.6994 2.828001
[13,] -76.7121 2.825099
[14,] -76.7259 2.825200
[15,] -76.7369 2.822301
[16,] -76.7444 2.818301
[17,] -76.7450 2.835700
[18,] -76.7438 2.857600
[19,] -76.7450 2.876701
[20,] -76.7462 2.908399
[21,] -76.7485 2.933301
[22,] -76.7571 2.951199
[23,] -76.7698 2.962800
[24,] -76.7865 2.973300
[25,] -76.7946 2.979700
[26,] -76.8021 2.991900
[27,] -76.8131 2.994799
[28,] -76.8338 2.997801
[29,] -76.8471 3.006500
[30,] -76.8471 3.011701
[31,] -76.8459 3.015100
[32,] -76.8454 3.020900
[33,] -76.8431 3.031300
[34,] -76.8390 3.049200
[35,] -76.8368 3.068800
[36,] -76.8414 3.076901
[37,] -76.8206 3.078601
[38,] -76.8079 3.080301
[39,] -76.7947 3.083699
[40,] -76.7855 3.087701
[41,] -76.7757 3.091100
[42,] -76.7705 3.094001
[43,] -76.7601 3.093901
[44,] -76.7503 3.093901
[45,] -76.7307 3.097301
[46,] -76.7048 3.101800
[47,] -76.6996 3.104100
[48,] -76.6806 3.105700
[49,] -76.6696 3.111999
[50,] -76.6546 3.107300
[51,] -76.6488 3.098600
[52,] -76.6425 3.097499
[53,] -76.6292 3.096800
[54,] -76.6212 3.099701
[55,] -76.6171 3.106001
[56,] -76.6125 3.111801
[57,] -76.6074 3.114101
[58,] -76.6016 3.115201
[59,] -76.5924 3.109401
[60,] -76.5877 3.103601
[61,] -76.5883 3.097201
[62,] -76.5883 3.092599
[63,] -76.5883 3.080499
[64,] -76.5912 3.060901
[65,] -76.5941 3.044099
[66,] -76.5935 3.032601
[67,] -76.5958 3.010001
[68,] -76.6061 2.995100
[69,] -76.6153 2.981200
[70,] -76.6171 2.974301
[71,] -76.6084 2.945401
[72,] -76.6153 2.928100
[73,] -76.6234 2.915401
[74,] -76.6297 2.893501
[75,] -76.6372 2.872699
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -76.703115 2.993272
Slot "ID":
[1] "5"
Slot "area":
[1] 0.04552716
[[6]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -76.751864 2.648973
Slot "area":
[1] 0.05647143
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -76.8180 2.580601
[2,] -76.8163 2.588701
[3,] -76.8157 2.601999
[4,] -76.8325 2.601500
[5,] -76.8480 2.600399
[6,] -76.8618 2.600500
[7,] -76.8734 2.610899
[8,] -76.9062 2.611100
[9,] -76.9091 2.616301
[10,] -76.9178 2.625000
[11,] -76.9282 2.634801
[12,] -76.9334 2.651001
[13,] -76.9351 2.671201
[14,] -76.9351 2.701901
[15,] -76.9282 2.741100
[16,] -76.9288 2.758400
[17,] -76.9213 2.754900
[18,] -76.9104 2.761300
[19,] -76.8890 2.768100
[20,] -76.8706 2.773201
[21,] -76.8556 2.774899
[22,] -76.8504 2.768499
[23,] -76.8377 2.758601
[24,] -76.8175 2.751600
[25,] -76.7818 2.750300
[26,] -76.7611 2.743901
[27,] -76.7449 2.735700
[28,] -76.7265 2.735101
[29,] -76.7103 2.723999
[30,] -76.7040 2.711300
[31,] -76.6855 2.711801
[32,] -76.6757 2.702500
[33,] -76.6682 2.689201
[34,] -76.6596 2.689201
[35,] -76.6642 2.683401
[36,] -76.6572 2.670100
[37,] -76.6498 2.664901
[38,] -76.6457 2.659600
[39,] -76.6301 2.653200
[40,] -76.6198 2.652601
[41,] -76.6002 2.647299
[42,] -76.5898 2.640900
[43,] -76.5771 2.633401
[44,] -76.5621 2.626400
[45,] -76.5483 2.619401
[46,] -76.5448 2.617600
[47,] -76.5344 2.618701
[48,] -76.5316 2.619300
[49,] -76.5241 2.622701
[50,] -76.5200 2.626199
[51,] -76.5120 2.627899
[52,] -76.5045 2.627300
[53,] -76.4987 2.623200
[54,] -76.4975 2.618001
[55,] -76.5091 2.616900
[56,] -76.5194 2.611699
[57,] -76.5194 2.605400
[58,] -76.5148 2.592700
[59,] -76.5096 2.578201
[60,] -76.5108 2.567801
[61,] -76.5258 2.562700
[62,] -76.5477 2.573200
[63,] -76.5650 2.588801
[64,] -76.5725 2.579600
[65,] -76.5765 2.558801
[66,] -76.5828 2.545000
[67,] -76.5868 2.539200
[68,] -76.5990 2.537600
[69,] -76.6237 2.543400
[70,] -76.6549 2.545301
[71,] -76.6785 2.554101
[72,] -76.7073 2.561700
[73,] -76.7408 2.563600
[74,] -76.7644 2.564799
[75,] -76.7909 2.570700
[76,] -76.8082 2.570800
[77,] -76.8174 2.570800
[78,] -76.8180 2.580601
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -76.751864 2.648973
Slot "ID":
[1] "6"
Slot "area":
[1] 0.05647143
Slot "plotOrder":
[1] 4 6 5 3 2 1
Slot "bbox":
min max
x -77.409088 -76.497498
y 1.596499 3.115201
Slot "proj4string":
CRS arguments: +proj=longlat +datum=WGS84 +no_defs
Para obtener el area de los municipios instalar la siguiente libreria y cargarla
#install.packages("lwgeom")
library(lwgeom)
calculamos el área de cada municipio (en metros cuadrados) de la siguiente manera
mun_cauca$area <- st_area(mun_cauca)
Creamos un campo para almacenar el área en kilómetros cuadrados y verificamos la salida
mun_cauca$km2 <- mun_cauca$area/(1000000)
mun_cauca$km2
Units: [m^2]
[1] 274.72660 406.61021 425.32006 937.90081 559.65249 694.38763
[7] 441.39622 427.19456 310.16505 3110.03278 28.42409 2290.54097
[13] 776.19762 288.18776 285.46309 511.56356 2618.86896 716.18639
[19] 150.93714 397.75317 1332.08401 112.85927 757.24137 143.80980
[25] 484.58346 100.17483 620.81551 167.99831 510.78564 4284.26094
[31] 519.01836 643.54302 471.71734 221.64733 302.87909 1817.89882
[37] 453.44198 567.48848
Nuevamente tenemos que hacer una conversión de características simples a polígonos espaciales y verificamos su contenido
cau_mun <- as(mun_cauca, 'Spatial')
head(cau_mun)
An object of class "SpatialPolygonsDataFrame"
Slot "data":
Slot "polygons":
[[1]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -76.882724 1.908871
Slot "area":
[1] 0.0223311
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -76.7739 1.969300
[2,] -76.7796 1.954900
[3,] -76.7888 1.938201
[4,] -76.7981 1.925000
[5,] -76.8050 1.905400
[6,] -76.8176 1.889801
[7,] -76.8263 1.874800
[8,] -76.8401 1.854700
[9,] -76.8608 1.839200
[10,] -76.8764 1.825400
[11,] -76.8954 1.811600
[12,] -76.9127 1.794900
[13,] -76.9190 1.794900
[14,] -76.9248 1.801300
[15,] -76.9300 1.813500
[16,] -76.9369 1.826799
[17,] -76.9369 1.844100
[18,] -76.9387 1.864300
[19,] -76.9502 1.888600
[20,] -76.9658 1.903100
[21,] -76.9814 1.922300
[22,] -76.9866 1.929800
[23,] -76.9750 1.933800
[24,] -76.9554 1.952200
[25,] -76.9422 1.955600
[26,] -76.9307 1.971201
[27,] -76.9186 1.980901
[28,] -76.8978 1.983100
[29,] -76.8921 1.989500
[30,] -76.8834 1.989400
[31,] -76.8788 1.988800
[32,] -76.8552 1.981801
[33,] -76.8390 1.979401
[34,] -76.8206 1.975301
[35,] -76.8067 1.975301
[36,] -76.7935 1.972301
[37,] -76.7796 1.968801
[38,] -76.7739 1.969300
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -76.882724 1.908871
Slot "ID":
[1] "1"
Slot "area":
[1] 0.0223311
[[2]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -77.284239 2.274516
Slot "area":
[1] 0.03305874
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -77.37980 2.159601
[2,] -77.38100 2.165401
[3,] -77.38270 2.175199
[4,] -77.38210 2.184500
[5,] -77.38910 2.195500
[6,] -77.39770 2.209400
[7,] -77.40000 2.211700
[8,] -77.40700 2.213400
[9,] -77.40909 2.213420
[10,] -77.40870 2.218601
[11,] -77.38910 2.222601
[12,] -77.36200 2.226500
[13,] -77.34530 2.238001
[14,] -77.35220 2.275000
[15,] -77.34760 2.301600
[16,] -77.33780 2.313700
[17,] -77.33380 2.336200
[18,] -77.33900 2.344901
[19,] -77.33560 2.361601
[20,] -77.31770 2.371900
[21,] -77.32278 2.377899
[22,] -77.31710 2.388100
[23,] -77.31020 2.393800
[24,] -77.29410 2.397201
[25,] -77.27560 2.393700
[26,] -77.25600 2.387200
[27,] -77.23810 2.377901
[28,] -77.19610 2.369101
[29,] -77.17240 2.369600
[30,] -77.15740 2.358501
[31,] -77.17300 2.357400
[32,] -77.17880 2.343600
[33,] -77.17700 2.329700
[34,] -77.17240 2.302001
[35,] -77.17240 2.295100
[36,] -77.18790 2.292800
[37,] -77.20750 2.296401
[38,] -77.21100 2.296401
[39,] -77.20980 2.279600
[40,] -77.20460 2.265200
[41,] -77.21040 2.255901
[42,] -77.22080 2.245599
[43,] -77.23060 2.237000
[44,] -77.23110 2.230600
[45,] -77.22650 2.225400
[46,] -77.23000 2.224800
[47,] -77.24150 2.204700
[48,] -77.24780 2.193100
[49,] -77.25420 2.183299
[50,] -77.26800 2.175901
[51,] -77.28760 2.173700
[52,] -77.29510 2.173100
[53,] -77.29680 2.162700
[54,] -77.31580 2.155300
[55,] -77.33660 2.152501
[56,] -77.35270 2.142200
[57,] -77.36710 2.138200
[58,] -77.37290 2.138801
[59,] -77.37980 2.159601
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -77.284239 2.274516
Slot "ID":
[1] "2"
Slot "area":
[1] 0.03305874
[[3]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -77.227759 2.106755
Slot "area":
[1] 0.03457614
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -77.24387 1.964288
[2,] -77.24660 1.967301
[3,] -77.26730 1.985801
[4,] -77.27710 1.994601
[5,] -77.28750 2.009000
[6,] -77.29040 2.021200
[7,] -77.28930 2.036801
[8,] -77.29040 2.046601
[9,] -77.29040 2.066200
[10,] -77.29220 2.085900
[11,] -77.30430 2.108500
[12,] -77.31180 2.108500
[13,] -77.32330 2.108500
[14,] -77.32790 2.102800
[15,] -77.33140 2.095300
[16,] -77.33370 2.087801
[17,] -77.34120 2.084900
[18,] -77.35670 2.084401
[19,] -77.36360 2.089599
[20,] -77.36710 2.100099
[21,] -77.36770 2.107600
[22,] -77.37170 2.119101
[23,] -77.37290 2.138801
[24,] -77.36710 2.138200
[25,] -77.35270 2.142200
[26,] -77.33660 2.152501
[27,] -77.31580 2.155300
[28,] -77.29680 2.162700
[29,] -77.29510 2.173100
[30,] -77.28760 2.173700
[31,] -77.26800 2.175901
[32,] -77.25420 2.183299
[33,] -77.24780 2.193100
[34,] -77.24150 2.204700
[35,] -77.23000 2.224800
[36,] -77.22650 2.225400
[37,] -77.21900 2.229399
[38,] -77.21330 2.222400
[39,] -77.20920 2.213199
[40,] -77.19480 2.201601
[41,] -77.17410 2.195101
[42,] -77.15680 2.187001
[43,] -77.13310 2.170101
[44,] -77.11980 2.157901
[45,] -77.10660 2.149201
[46,] -77.10480 2.131301
[47,] -77.11170 2.112300
[48,] -77.12610 2.085201
[49,] -77.13360 2.073101
[50,] -77.14400 2.051800
[51,] -77.15490 2.040801
[52,] -77.17570 2.035101
[53,] -77.20510 2.032999
[54,] -77.21080 2.022000
[55,] -77.21600 2.010500
[56,] -77.22290 1.993700
[57,] -77.23220 1.983401
[58,] -77.23910 1.971301
[59,] -77.24387 1.964288
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -77.227759 2.106755
Slot "ID":
[1] "3"
Slot "area":
[1] 0.03457614
[[4]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -76.982924 1.846701
Slot "area":
[1] 0.07623461
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -76.91090 1.630800
[2,] -76.91490 1.633200
[3,] -76.92820 1.642499
[4,] -76.94370 1.650599
[5,] -76.95470 1.657601
[6,] -76.96620 1.664001
[7,] -76.98930 1.683701
[8,] -77.00950 1.698299
[9,] -77.01870 1.701800
[10,] -77.03600 1.714000
[11,] -77.04700 1.716300
[12,] -77.06140 1.715801
[13,] -77.06600 1.724500
[14,] -77.07230 1.738401
[15,] -77.07010 1.775899
[16,] -77.06260 1.786901
[17,] -77.04930 1.800101
[18,] -77.05850 1.818601
[19,] -77.07300 1.819301
[20,] -77.08680 1.823401
[21,] -77.10760 1.826899
[22,] -77.10580 1.847701
[23,] -77.10240 1.858101
[24,] -77.10180 1.871400
[25,] -77.10700 1.888101
[26,] -77.11340 1.898601
[27,] -77.12430 1.911900
[28,] -77.13410 1.927501
[29,] -77.14220 1.943199
[30,] -77.14340 1.956999
[31,] -77.15780 1.957100
[32,] -77.15490 1.967499
[33,] -77.13700 1.980101
[34,] -77.08980 2.004699
[35,] -77.06790 2.015001
[36,] -77.04200 2.034599
[37,] -77.01890 2.050701
[38,] -77.00680 2.076599
[39,] -76.99990 2.088100
[40,] -76.98610 2.113501
[41,] -76.97510 2.118601
[42,] -76.97230 2.120901
[43,] -76.96650 2.105300
[44,] -76.96470 2.093201
[45,] -76.96240 2.079300
[46,] -76.95200 2.071200
[47,] -76.93650 2.061901
[48,] -76.92670 2.053199
[49,] -76.91570 2.039201
[50,] -76.90360 2.022401
[51,] -76.89550 2.013201
[52,] -76.88690 2.001000
[53,] -76.88340 1.989400
[54,] -76.89210 1.989500
[55,] -76.89780 1.983100
[56,] -76.91860 1.980901
[57,] -76.93070 1.971201
[58,] -76.94220 1.955600
[59,] -76.95540 1.952200
[60,] -76.97500 1.933800
[61,] -76.98660 1.929800
[62,] -76.98140 1.922300
[63,] -76.96580 1.903100
[64,] -76.95020 1.888600
[65,] -76.93870 1.864300
[66,] -76.93690 1.844100
[67,] -76.93690 1.826799
[68,] -76.93000 1.813500
[69,] -76.92480 1.801300
[70,] -76.91900 1.794900
[71,] -76.91500 1.782800
[72,] -76.90750 1.771801
[73,] -76.89650 1.759601
[74,] -76.88210 1.758400
[75,] -76.86540 1.752499
[76,] -76.85270 1.751301
[77,] -76.84580 1.740901
[78,] -76.83080 1.737400
[79,] -76.82555 1.736315
[80,] -76.82100 1.719399
[81,] -76.82210 1.697499
[82,] -76.82270 1.677801
[83,] -76.82100 1.668600
[84,] -76.81810 1.646599
[85,] -76.82040 1.624701
[86,] -76.82440 1.613700
[87,] -76.82960 1.603401
[88,] -76.83650 1.596499
[89,] -76.85320 1.600600
[90,] -76.86470 1.606999
[91,] -76.88030 1.613401
[92,] -76.89470 1.622700
[93,] -76.91090 1.630800
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -76.982924 1.846701
Slot "ID":
[1] "4"
Slot "area":
[1] 0.07623461
[[5]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -76.703115 2.993272
Slot "area":
[1] 0.04552716
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -76.6372 2.872699
[2,] -76.6453 2.877401
[3,] -76.6539 2.877401
[4,] -76.6614 2.875701
[5,] -76.6660 2.871101
[6,] -76.6723 2.862500
[7,] -76.6746 2.857301
[8,] -76.6781 2.850999
[9,] -76.6810 2.846400
[10,] -76.6844 2.838300
[11,] -76.6890 2.831401
[12,] -76.6994 2.828001
[13,] -76.7121 2.825099
[14,] -76.7259 2.825200
[15,] -76.7369 2.822301
[16,] -76.7444 2.818301
[17,] -76.7450 2.835700
[18,] -76.7438 2.857600
[19,] -76.7450 2.876701
[20,] -76.7462 2.908399
[21,] -76.7485 2.933301
[22,] -76.7571 2.951199
[23,] -76.7698 2.962800
[24,] -76.7865 2.973300
[25,] -76.7946 2.979700
[26,] -76.8021 2.991900
[27,] -76.8131 2.994799
[28,] -76.8338 2.997801
[29,] -76.8471 3.006500
[30,] -76.8471 3.011701
[31,] -76.8459 3.015100
[32,] -76.8454 3.020900
[33,] -76.8431 3.031300
[34,] -76.8390 3.049200
[35,] -76.8368 3.068800
[36,] -76.8414 3.076901
[37,] -76.8206 3.078601
[38,] -76.8079 3.080301
[39,] -76.7947 3.083699
[40,] -76.7855 3.087701
[41,] -76.7757 3.091100
[42,] -76.7705 3.094001
[43,] -76.7601 3.093901
[44,] -76.7503 3.093901
[45,] -76.7307 3.097301
[46,] -76.7048 3.101800
[47,] -76.6996 3.104100
[48,] -76.6806 3.105700
[49,] -76.6696 3.111999
[50,] -76.6546 3.107300
[51,] -76.6488 3.098600
[52,] -76.6425 3.097499
[53,] -76.6292 3.096800
[54,] -76.6212 3.099701
[55,] -76.6171 3.106001
[56,] -76.6125 3.111801
[57,] -76.6074 3.114101
[58,] -76.6016 3.115201
[59,] -76.5924 3.109401
[60,] -76.5877 3.103601
[61,] -76.5883 3.097201
[62,] -76.5883 3.092599
[63,] -76.5883 3.080499
[64,] -76.5912 3.060901
[65,] -76.5941 3.044099
[66,] -76.5935 3.032601
[67,] -76.5958 3.010001
[68,] -76.6061 2.995100
[69,] -76.6153 2.981200
[70,] -76.6171 2.974301
[71,] -76.6084 2.945401
[72,] -76.6153 2.928100
[73,] -76.6234 2.915401
[74,] -76.6297 2.893501
[75,] -76.6372 2.872699
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -76.703115 2.993272
Slot "ID":
[1] "5"
Slot "area":
[1] 0.04552716
[[6]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -76.751864 2.648973
Slot "area":
[1] 0.05647143
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -76.8180 2.580601
[2,] -76.8163 2.588701
[3,] -76.8157 2.601999
[4,] -76.8325 2.601500
[5,] -76.8480 2.600399
[6,] -76.8618 2.600500
[7,] -76.8734 2.610899
[8,] -76.9062 2.611100
[9,] -76.9091 2.616301
[10,] -76.9178 2.625000
[11,] -76.9282 2.634801
[12,] -76.9334 2.651001
[13,] -76.9351 2.671201
[14,] -76.9351 2.701901
[15,] -76.9282 2.741100
[16,] -76.9288 2.758400
[17,] -76.9213 2.754900
[18,] -76.9104 2.761300
[19,] -76.8890 2.768100
[20,] -76.8706 2.773201
[21,] -76.8556 2.774899
[22,] -76.8504 2.768499
[23,] -76.8377 2.758601
[24,] -76.8175 2.751600
[25,] -76.7818 2.750300
[26,] -76.7611 2.743901
[27,] -76.7449 2.735700
[28,] -76.7265 2.735101
[29,] -76.7103 2.723999
[30,] -76.7040 2.711300
[31,] -76.6855 2.711801
[32,] -76.6757 2.702500
[33,] -76.6682 2.689201
[34,] -76.6596 2.689201
[35,] -76.6642 2.683401
[36,] -76.6572 2.670100
[37,] -76.6498 2.664901
[38,] -76.6457 2.659600
[39,] -76.6301 2.653200
[40,] -76.6198 2.652601
[41,] -76.6002 2.647299
[42,] -76.5898 2.640900
[43,] -76.5771 2.633401
[44,] -76.5621 2.626400
[45,] -76.5483 2.619401
[46,] -76.5448 2.617600
[47,] -76.5344 2.618701
[48,] -76.5316 2.619300
[49,] -76.5241 2.622701
[50,] -76.5200 2.626199
[51,] -76.5120 2.627899
[52,] -76.5045 2.627300
[53,] -76.4987 2.623200
[54,] -76.4975 2.618001
[55,] -76.5091 2.616900
[56,] -76.5194 2.611699
[57,] -76.5194 2.605400
[58,] -76.5148 2.592700
[59,] -76.5096 2.578201
[60,] -76.5108 2.567801
[61,] -76.5258 2.562700
[62,] -76.5477 2.573200
[63,] -76.5650 2.588801
[64,] -76.5725 2.579600
[65,] -76.5765 2.558801
[66,] -76.5828 2.545000
[67,] -76.5868 2.539200
[68,] -76.5990 2.537600
[69,] -76.6237 2.543400
[70,] -76.6549 2.545301
[71,] -76.6785 2.554101
[72,] -76.7073 2.561700
[73,] -76.7408 2.563600
[74,] -76.7644 2.564799
[75,] -76.7909 2.570700
[76,] -76.8082 2.570800
[77,] -76.8174 2.570800
[78,] -76.8180 2.580601
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -76.751864 2.648973
Slot "ID":
[1] "6"
Slot "area":
[1] 0.05647143
Slot "plotOrder":
[1] 4 6 5 3 2 1
Slot "bbox":
min max
x -77.409088 -76.497498
y 1.596499 3.115201
Slot "proj4string":
CRS arguments: +proj=longlat +datum=WGS84 +no_defs
Ahora preparamos el plot
bins <- c(0, 50, 100, 200, 300, 500, 1000, 2000, Inf)
pal <- colorBin("OrRd", domain = cau_mun$km2, bins = bins)
labels <- mun_cauca$NAME_2
labels
[1] "Almaguer" "Argelia"
[3] "Balboa" "Bolívar"
[5] "Buenos Aires" "Cajibío"
[7] "Caldonó" "Caloto"
[9] "Corinto" "El Tambo"
[11] "Florencia" "Guapí"
[13] "Inzá" "Jambaló"
[15] "La Sierra" "La Vega"
[17] "López de Micay" "Mercaderes"
[19] "Miranda" "Morales"
[21] "Páez" "Padilla"
[23] "Patía" "Piendamó"
[25] "Popayán" "Puerto Tejada"
[27] "Puracé" "Rosas"
[29] "San Sebastián" "Santa Rosa"
[31] "Santander de Quilichao" "Silvia"
[33] "Sotará" "Suárez"
[35] "Timbío" "Timbiquí"
[37] "Toribío" "Totoró"
es hora de crear el plot
m <- leaflet(cau_mun) %>%
addProviderTiles(providers$CartoDB.PositronNoLabels) %>%
setView(-77, 2, 7.4) %>% addPolygons(
fillColor = ~pal(km2),
weight = 2,
opacity = 1,
color = "black",
dashArray = "3",
fillOpacity = 0.7,
highlight = highlightOptions(
weight = 5,
color = "#800",
dashArray = "",
fillOpacity = 0.7,
bringToFront = TRUE),
label = labels) %>%
addLegend(pal = pal, values = ~km2, opacity = 0.7, title = NULL,
position = "bottomright")
ahora visualizaremos el plot
m
NA
Puede probar diferentes proveedores para mejorar su mapa. ¡Aproveche la función de completar con pestañas para seleccionar el mapa base preferido simplemente desplazándose por la lista de proveedores con addProviderTiles()
cap_cauca <- munic %>% filter(NAME_2 == "Popayán")
cap_cauca$area <- st_area(cap_cauca)
cap_cauca$km2 <-cap_cauca$area/(1000000)
cap_cauca$km2
484.5835 [m^2]
cau_cap <- as(cap_cauca, 'Spatial')
pal <- colorBin("OrRd", domain = cau_cap$km2, bins = bins)
Pop1 <- leaflet(cau_cap) %>%
addProviderTiles( providers$Stamen.Toner) %>%
setView(-76.6, 2.445, 14) %>%
addPolygons(data = cau_cap, popup= cau_cap$NAME_2
,
stroke = TRUE, fillOpacity = 0.1, smoothFactor = 0.1, fillColor = "Set1")
Pop1
pal <- colorBin("OrRd", domain = cau_cap$km2, bins = bins)
Pop2 <- leaflet(cau_cap) %>%
addProviderTiles(providers$OpenStreetMap.Mapnik) %>%
setView(-76.6, 2.445, 14) %>%
addPolygons(data = cau_cap, popup= cau_cap$NAME_2
,
stroke = TRUE, fillOpacity = 0.1, smoothFactor = 0.1, fillColor = "Set1")
Pop2
sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=Spanish_Mexico.1252 LC_CTYPE=Spanish_Mexico.1252
[3] LC_MONETARY=Spanish_Mexico.1252 LC_NUMERIC=C
[5] LC_TIME=Spanish_Mexico.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lwgeom_0.2-5 leaflet_2.0.3 scales_1.1.1 sf_0.9-5
[5] forcats_0.5.0 stringr_1.4.0 dplyr_1.0.2 purrr_0.3.4
[9] readr_1.3.1 tidyr_1.1.2 tibble_3.0.3 ggplot2_3.3.2
[13] tidyverse_1.3.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 lubridate_1.7.9
[3] lattice_0.20-41 leaflet.providers_1.9.0
[5] class_7.3-17 assertthat_0.2.1
[7] digest_0.6.25 R6_2.4.1
[9] cellranger_1.1.0 backports_1.1.7
[11] reprex_0.3.0 evaluate_0.14
[13] e1071_1.7-3 httr_1.4.2
[15] pillar_1.4.6 rlang_0.4.7
[17] readxl_1.3.1 rstudioapi_0.11
[19] blob_1.2.1 rmarkdown_2.3
[21] htmlwidgets_1.5.1 munsell_0.5.0
[23] broom_0.7.0 compiler_4.0.2
[25] modelr_0.1.8 xfun_0.16
[27] base64enc_0.1-3 pkgconfig_2.0.3
[29] htmltools_0.5.0 tidyselect_1.1.0
[31] fansi_0.4.1 crayon_1.3.4
[33] dbplyr_1.4.4 withr_2.2.0
[35] grid_4.0.2 jsonlite_1.7.0
[37] gtable_0.3.0 lifecycle_0.2.0
[39] DBI_1.1.0 magrittr_1.5
[41] units_0.6-7 KernSmooth_2.23-17
[43] cli_2.0.2 stringi_1.4.6
[45] farver_2.0.3 fs_1.5.0
[47] sp_1.4-2 xml2_1.3.2
[49] ellipsis_0.3.1 generics_0.0.2
[51] vctrs_0.3.3 RColorBrewer_1.1-2
[53] tools_4.0.2 glue_1.4.2
[55] hms_0.5.3 crosstalk_1.1.0.1
[57] yaml_2.2.1 colorspace_1.4-1
[59] classInt_0.4-3 rvest_0.3.6
[61] knitr_1.29 haven_2.3.1