split en deux fichiers
This commit is contained in:
parent
e9c17afdfb
commit
9db812694b
3 changed files with 26 additions and 45 deletions
|
@ -24,24 +24,3 @@ geo_frigo[4, ] <- list(-67.4330588, 48.4657985)
|
|||
frigo_table3 <- frigo_table2 %>% cbind(geo_frigo)
|
||||
|
||||
frigo_table3 %>% write.csv("frigo_table.csv")
|
||||
|
||||
library(sf)
|
||||
|
||||
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)
|
||||
|
||||
leaflet(data = frigo_table_sf) %>%
|
||||
addTiles() %>%
|
||||
addMarkers(popup = ~ paste0(
|
||||
'<h2>',
|
||||
Quoi,
|
||||
'</h2><p>',
|
||||
Adresse,
|
||||
"</p>",
|
||||
Particularités %>%
|
||||
str_replace_all("\\n", "<br>")
|
||||
))
|
File diff suppressed because one or more lines are too long
26
leaflet.R
Normal file
26
leaflet.R
Normal file
|
@ -0,0 +1,26 @@
|
|||
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")
|
Loading…
Add table
Reference in a new issue