27 lines
519 B
R
27 lines
519 B
R
|
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")
|