Commit 11a6bf72 authored by Grelot Frederic's avatar Grelot Frederic :swimmer_tone5:
Browse files

Ajout du fichier exemple

Showing with 27 additions and 0 deletions
+27 -0
map_so_ii.rmd 0 → 100644
# 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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment