diff --git a/map_so_ii.rmd b/map_so_ii.rmd new file mode 100644 index 0000000000000000000000000000000000000000..7b34aae51df2f463ed5c06b1e724970a393937f7 --- /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