diff --git a/frigos.R b/extraction.R similarity index 64% rename from frigos.R rename to extraction.R index cfee904..8834c02 100644 --- a/frigos.R +++ b/extraction.R @@ -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( - '

', - Quoi, - '

', - Adresse, - "

", - Particularités %>% - str_replace_all("\\n", "
") - )) diff --git a/frigo_carte.html b/frigo_carte.html deleted file mode 100644 index 8d46f2b..0000000 --- a/frigo_carte.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - -
-
-
- - - - diff --git a/leaflet.R b/leaflet.R new file mode 100644 index 0000000..7939aea --- /dev/null +++ b/leaflet.R @@ -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( + '

', + Quoi, + '

', + Adresse, + "

", + Particularités %>% + str_replace_all("\\n", "
") + )) + +library(htmlwidgets) +saveWidget(l, file="frigo_carte.html")