Skip to content
Snippets Groups Projects

Resolve "Chronologie élaborée à partir du chiffre correspondant à la diminution par deux de la consommation de sols effectuée dans la décennie passée"

4 files
+ 64
6
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 17
6
@@ -12,7 +12,6 @@
@@ -12,7 +12,6 @@
#' @importFrom gouvdown scale_color_gouv_discrete scale_fill_gouv_discrete
#' @importFrom gouvdown scale_color_gouv_discrete scale_fill_gouv_discrete
#' @importFrom lubridate ymd year years
#' @importFrom lubridate ymd year years
#' @importFrom mapfactory format_fr_nb
#' @importFrom mapfactory format_fr_nb
#' @importFrom propre.artificialisation observatoire_artificialisation
#' @importFrom scales label_number
#' @importFrom scales label_number
#' @importFrom tibble tibble
#' @importFrom tibble tibble
#' @importFrom tidyr crossing
#' @importFrom tidyr crossing
@@ -21,7 +20,11 @@
@@ -21,7 +20,11 @@
#' @examples
#' @examples
#' creer_graphe_5_2(2019,'52')
#' creer_graphe_5_2(2019,'52')
creer_graphe_5_2 <- function(millesime_obs_artif,code_reg) {
creer_graphe_5_2 <- function(millesime_obs_artif,code_reg) {
data <- propre.artificialisation::observatoire_artificialisation %>%
if (is.numeric(code_reg)) {
 
code_reg = as.character(code_reg)
 
}
 
 
data <- observatoire_artificialisation %>%
COGiter::filtrer_cog(reg = code_reg) %>%
COGiter::filtrer_cog(reg = code_reg) %>%
dplyr::filter(TypeZone %in% c("R\u00e9gions","D\u00e9partements")) %>%
dplyr::filter(TypeZone %in% c("R\u00e9gions","D\u00e9partements")) %>%
dplyr::select(TypeZone,Zone,date,flux_naf_artificialisation_total) %>%
dplyr::select(TypeZone,Zone,date,flux_naf_artificialisation_total) %>%
@@ -39,7 +42,7 @@ creer_graphe_5_2 <- function(millesime_obs_artif,code_reg) {
@@ -39,7 +42,7 @@ creer_graphe_5_2 <- function(millesime_obs_artif,code_reg) {
flux_naf_artificialisation_total_objectif = mean(.5 * flux_naf_artificialisation_total)) %>%
flux_naf_artificialisation_total_objectif = mean(.5 * flux_naf_artificialisation_total)) %>%
dplyr::mutate(simul=TRUE)
dplyr::mutate(simul=TRUE)
seq_prochaines_annees <- seq(datemax + lubridate::years(1),datemax + lubridate::years(10), by = '1 year')
seq_prochaines_annees <- seq(datemax + lubridate::years(1),datemax + lubridate::years(11), by = '1 year')
data_prochaines_annees <- tibble::tibble(date = seq_prochaines_annees) %>%
data_prochaines_annees <- tibble::tibble(date = seq_prochaines_annees) %>%
@@ -127,10 +130,14 @@ creer_graphe_5_2 <- function(millesime_obs_artif,code_reg) {
@@ -127,10 +130,14 @@ creer_graphe_5_2 <- function(millesime_obs_artif,code_reg) {
limits = c(0, NA),
limits = c(0, NA),
labels = scales::label_number(big.mark = " ", decimal.mark = ",")
labels = scales::label_number(big.mark = " ", decimal.mark = ",")
) +
) +
ggplot2::coord_cartesian(clip = "off") +
ggplot2::scale_x_date(
 
date_breaks = "5 years",
 
date_labels = "%Y"
 
)+
 
ggplot2::coord_cartesian(clip = "off",expand = FALSE) +
ggplot2::theme(
ggplot2::theme(
legend.position = "none",
legend.position = "none",
plot.margin = unit(c(1, 8, 1, 1), "lines")
plot.margin = unit(c(1, 9, 1, 1), "lines")
) +
) +
gouvdown::scale_color_gouv_discrete(palette = "pal_gouv_qual1") +
gouvdown::scale_color_gouv_discrete(palette = "pal_gouv_qual1") +
gouvdown::scale_fill_gouv_discrete(palette = "pal_gouv_qual1")
gouvdown::scale_fill_gouv_discrete(palette = "pal_gouv_qual1")
@@ -157,7 +164,11 @@ creer_graphe_5_2 <- function(millesime_obs_artif,code_reg) {
@@ -157,7 +164,11 @@ creer_graphe_5_2 <- function(millesime_obs_artif,code_reg) {
limits = c(0, NA),
limits = c(0, NA),
labels = scales::label_number(big.mark = " ", decimal.mark = ",")
labels = scales::label_number(big.mark = " ", decimal.mark = ",")
) +
) +
ggplot2::coord_cartesian(clip = "off") +
ggplot2::scale_x_date(
 
date_breaks = "5 years",
 
date_labels = "%Y"
 
)+
 
ggplot2::coord_cartesian(clip = "off",expand = FALSE) +
ggplot2::theme(
ggplot2::theme(
legend.position = "none",
legend.position = "none",
plot.margin = unit(c(1, 8, 1, 1), "lines")
plot.margin = unit(c(1, 8, 1, 1), "lines")
Loading