knitr::opts_chunk$set( collapse = TRUE, comment = "#>", warning = FALSE, message = FALSE )
library(jpmesh) library(sf)
df_polys <- meshcode_set(mesh_size = 80) %>% jpmesh::export_meshes()
df_polys %>% st_geometry() %>% plot()
library(ggplot2) ggplot() + geom_sf(data = df_polys, fill = NA) + geom_text( data = cbind( mesh = df_polys$meshcode, df_polys$geometry %>% st_centroid() %>% st_coordinates() %>% as.data.frame() ), aes(X, Y, label = mesh), size = 1.2 ) + coord_sf(datum = NA) + theme_void()
library(leaflet) leaflet() %>% addTiles() %>% addPolygons(data = df_polys)
wip...
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.