From 11a6bf72a697c4705f7cfdb760a66274f9c3d411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Grelot?= <frederic.grelot@irstea.fr> Date: Wed, 19 Jan 2022 14:33:57 +0100 Subject: [PATCH] Ajout du fichier exemple --- map_so_ii.rmd | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 map_so_ii.rmd diff --git a/map_so_ii.rmd b/map_so_ii.rmd new file mode 100644 index 0000000..7b34aae --- /dev/null +++ b/map_so_ii.rmd @@ -0,0 +1,27 @@ +# Can only work if data-common is a symbolic link + +# Data to be plotted +dataset = rio::import("data-common/table/so-ii/rex-2020.ods", which = 1) +dataset = dataset[!is.na(dataset$latitude), ] +dataset = sf::st_as_sf(dataset, coords = c("longitude", "latitude"), crs = "WGS84") + +# Data preparation +bg = rep(NA, nrow(dataset)) +bg[dataset[["viticulture"]]] = "deeppink4" +bg[dataset[["habitant"]]] = "cornflowerblue" +col = "black" +cex = 1.4 +pch = 21 + +# Legend definition +dataset_legend = list( + title = "Enquêtes du REX 19 septembre 2020", + legend = c("Agriculteurs", "Habitants membre ROI"), + pch = 21, + pt.bg = c("deeppink4", "cornflowerblue"), + pt.cex = 1.4 +) + +map_so_ii(dataset, dataset_legend, path = "toto.pdf", bg = bg, cex = cex, col = col, pch = pch) +map_so_ii(dataset, dataset_legend, path = "toto.png", bg = bg, cex = cex, col = col, pch = pch) +map_so_ii(dataset, dataset_legend, path = "toto.pdf", bg = bg, pch = 22) \ No newline at end of file -- GitLab