library(sf)
library(leaflet)
caminho_shapefile <- “caminho”
municipio <-
st_read(caminho_shapefile)
#Transforme os dados para o datum desejado (WGS84)
municipio
<- st_transform(municipio, crs = st_crs(“+proj=longlat
+datum=WGS84”))
mapa <- leaflet() %>%
addProviderTiles(“OpenStreetMap.Mapnik”) %>%
addPolygons(data =
municipio, fillColor = “red”, color = “black”, weight = 1)
Para carregar vários arquivos
mydf %>%
group_by(Sample) %>% # for each unique sample
arrange(-total_reads) %>% # order by total_reads DESC
slice(1) # select the first row, i.e. with highest total_reads