Commit 5a002356 authored by Balzergue Pierre's avatar Balzergue Pierre :bicyclist_tone4:
Browse files

First commit

parent 69449077
No related merge requests found
Showing with 55 additions and 0 deletions
+55 -0
```{r data-recup}
# chargement des bibliothèques
library(geau)
library(sf)
# declaration de parametres
output_path = "data-common/figure/so-ii/map/"
crs = "WGS84"
# Récupération des données (à faire une fois)
suiviadapt = read.csv("data-common/table/so-ii/adapt-suivi-communes.csv", header = TRUE)
```
```{r adresses}
adresses_obs = merge(suiviadapt, geau::so_ii_commune, by.x = "commune", by.y = "code")
adresses_obs[["class"]] = cut(adresses_obs[["adresses"]], dig.lab = 0, breaks = c(0,100,200,1010,3500,5000,11000,50000))
adresses_obs[["color"]] = scales::col_factor("Oranges", domain = NULL)(adresses_obs[["class"]])
## Légende Carte en cours
dataset_legend = list(
title = "Adresses par communes",
legend = c("0-100","100-200","200-1010","1010-3500","3500-5000","5000-11000","11000-50000"),
pch = 21,
col = "black",
pt.bg = RColorBrewer::brewer.pal(9, "Oranges"),
pt.cex = 1.4)
## Production carte
map_so_ii(adresses_obs, col = adresses_obs[["color"]], dataset_legend, path = file.path(output_path, "adresses_BAN_commune.pdf"))
```
```{r propobs}
prop_obs = merge(suiviadapt, geau::so_ii_commune, by.x = "commune", by.y = "code")
prop_obs[["class"]] = cut(prop_obs[["proportion_obs"]], dig.lab = 0, breaks = c(0,30,50,60,90,100))
prop_obs[["color"]] = scales::col_factor("Oranges", domain = NULL)(prop_obs[["class"]])
## Légende Carte en cours
dataset_legend = list(
title = "Proportion adresses observées",
legend = c("0","<30","30-60","60-90","100"),
pch = 21,
col = "black",
pt.bg = RColorBrewer::brewer.pal(5, "Oranges"),
pt.cex = 1.4)
## Production carte
map_so_ii(prop_obs, col = proportion_obs[["color"]], dataset_legend, path = file.path(output_path, "prop_adresses_obs.pdf"))
```
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