frigos_localisation/leaflet.R

27 lines
519 B
R
Raw Normal View History

2022-01-14 12:38:39 -05:00
library(sf)
library(here)
frigo_table3 <- read.csv("frigo_table.csv")
frigo_table_sf <- sf::st_as_sf(frigo_table3, coords = c("lon", "lat"))
frigo_table_sf %>% sf::write_sf("frigo_table_sf.geojson")
library(leaflet)
library(htmltools)
l <- leaflet(data = frigo_table_sf) %>%
addTiles() %>%
addMarkers(popup = ~ paste0(
'<h2>',
Quoi,
'</h2><p>',
Adresse,
"</p>",
Particularités %>%
str_replace_all("\\n", "<br>")
))
library(htmlwidgets)
saveWidget(l, file="frigo_carte.html")