# load data
dvf = read.csv2("data/FrenchOpenData/territoires/foncier/full.csv", sep = ",")
# process coordinates
dvf$longitude = as.numeric(as.character(dvf$longitude))
dvf$latitude = as.numeric(as.character(dvf$latitude))
# sample
dvf_sample = sample_n(dvf, 100)
# plot
library(leaflet)
library(leaflet.providers)
m = leaflet() %>%
# Add CartoDB background map
addProviderTiles("CartoDB.DarkMatter") %>%
# Add a marker for each stop
addCircleMarkers(lng= ~ longitude, lat= ~latitude, data = dvf_sample,
stroke = FALSE, fillOpacity = 0.5, radius =2,
popup = paste("Adresse nom de voie:", dvf_sample$adresse_nom_voie, "<br>",
"Date mutation:", dvf_sample$date_mutation, "<br>",
"Valeur foncière:", dvf_sample$valeur_fonciere, "<br>",
"Type:", dvf_sample$type_local, "<br>"))
m # Show the map