mirror of
https://github.com/ArthurDanjou/ArtStudies.git
synced 2026-02-01 08:29:34 +01:00
Fix mapview example: enable code evaluation and correct st_as_sf usage with coordinates and CRS.
This commit is contained in:
@@ -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
|
production afficher uniquement quelques points. Vous pourrez ajouter
|
||||||
l'ensemble du jeu de données quand votre code sera finalisé.
|
l'ensemble du jeu de données quand votre code sera finalisé.
|
||||||
|
|
||||||
```{r, eval=F}
|
```{r}
|
||||||
library(mapview)
|
library(mapview)
|
||||||
library(sf)
|
library(sf)
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@ df_map_dyn <- accidents |>
|
|||||||
na.omit()
|
na.omit()
|
||||||
|
|
||||||
# Make map and print it
|
# 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é",
|
mapview(mymap, cex = 2, layer.name = "Gravité",
|
||||||
zcol = "grav",legend = TRUE )
|
zcol = "grav",legend = TRUE )
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user