From dec54d91d765758ec36b09dee1471ea07850bf7d Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Thu, 6 Nov 2025 11:44:18 +0100 Subject: [PATCH] Fix mapview example: enable code evaluation and correct st_as_sf usage with coordinates and CRS. --- M2/Data Visualisation/tp2/tp2.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/M2/Data Visualisation/tp2/tp2.Rmd b/M2/Data Visualisation/tp2/tp2.Rmd index f720d75..d06cc28 100644 --- a/M2/Data Visualisation/tp2/tp2.Rmd +++ b/M2/Data Visualisation/tp2/tp2.Rmd @@ -333,7 +333,7 @@ Voici un premier code à trou pour vous aider. Pour alléger les temps de production afficher uniquement quelques points. Vous pourrez ajouter l'ensemble du jeu de données quand votre code sera finalisé. -```{r, eval=F} +```{r} library(mapview) library(sf) @@ -343,7 +343,7 @@ df_map_dyn <- accidents |> na.omit() # Make map and print it -mymap <- st_as_sf() +mymap <- st_as_sf(df_map_dyn, coords=c("long", "lat"), crs=4326) mapview(mymap, cex = 2, layer.name = "Gravité", zcol = "grav",legend = TRUE ) ```