From 2e078e8e5df139a3439d431d2e2cb674fb2acf53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Grelot?= <frederic.grelot@irstea.fr> Date: Thu, 27 Jan 2022 09:56:43 +0100 Subject: [PATCH] MAJ map/map_so_ii.rmd --- map/map_so_ii.rmd | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/map/map_so_ii.rmd b/map/map_so_ii.rmd index 86652f3..fdfde95 100644 --- a/map/map_so_ii.rmd +++ b/map/map_so_ii.rmd @@ -4,7 +4,7 @@ library(sf) library(geau) ``` -```{r update-map} +```{r update-theme} path = "data-common/figure/so-ii/map/theme/so-ii-%s.pdf" map_so_ii(theme = "osm", theme_legend = TRUE, path = sprintf(path, "osm")) @@ -13,6 +13,7 @@ map_so_ii(theme = "collectivity", theme_legend = TRUE, detail = "syndicate", pat map_so_ii(theme = "collectivity", theme_legend = TRUE, detail = "epci", path = sprintf(path, "epci")) map_so_ii(theme = "clc", theme_legend = TRUE, path = sprintf(path, "clc")) map_so_ii(theme = "population", theme_legend = TRUE, path = sprintf(path, "population")) +map_so_ii(theme = "population", year = 1931, theme_legend = TRUE, path = sprintf(path, "population-1931")) map_so_ii(theme = "population", year = 2018:2019, theme_legend = TRUE, path = sprintf(path, "population-last")) map_so_ii(theme = "population", year = 2014:2019, theme_legend = TRUE, path = sprintf(path, "population-last-5")) map_so_ii(theme = "catnat", theme_legend = TRUE, path = sprintf(path, "catnat")) @@ -28,3 +29,33 @@ map_so_ii(theme = "onrn", detail = "ratio", theme_legend = TRUE, path = sprintf( map_so_ii(theme = "onrn", detail = "balance", theme_legend = TRUE, path = sprintf(path, "balance")) map_so_ii(theme = "onrn", detail = "ppri_year", theme_legend = TRUE, path = sprintf(path, "ppri_year")) ``` + +```{r update-rex-example} +path = "data-common/figure/so-ii/map/rex/so-ii-%s.pdf" + +dataset = readODS::read_ods("data-common/table/so-ii/rex-2020-09-19-enquete.ods") +dataset = sf::st_as_sf(dataset, coords = c("longitude", "latitude"), crs = "WGS84") + +pch = c( + "habitant" = 21, + "agriculteur" = 24 +) + +color = c( + "cereale" = "yellow", + "habitant" = "black", + "viticulture" = "purple", + "maraichage" = "red" +) + +cex = 2 + +map_so_ii( + dataset, + main = "Contact", + pch = pch[dataset[["statut"]]], + bg = color[dataset[["activite"]]], + cex = 2, + theme = "clc" +) +``` \ No newline at end of file -- GitLab