Skip to content
Snippets Groups Projects
Commit 12fe60f2 authored by Juliette Engelaere-Lefebvre's avatar Juliette Engelaere-Lefebvre
Browse files

Merge branch 'master' of gitlab.com:dreal-datalab/exploration-lettre-eolien-pv-trim

parents 9b2ffc41 02fb61c4
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ library(lubridate) ...@@ -9,7 +9,7 @@ library(lubridate)
library(tricky) library(tricky)
# Datapréparation SIGLOIRE ---------- # datapréparation SIGLOIRE ----------
mats_eolien_1 <-sf::st_read("https://catalogue.sigloire.fr/api/data/25823933-a92c-4d78-bacf-1cfcf339fd56") %>% # 1171 obs mats_eolien_1 <-sf::st_read("https://catalogue.sigloire.fr/api/data/25823933-a92c-4d78-bacf-1cfcf339fd56") %>% # 1171 obs
mutate(id_mat = paste0(id_au, "_", numero)) mutate(id_mat = paste0(id_au, "_", numero))
...@@ -40,9 +40,7 @@ parcs_eolien <- sf::st_read("https://catalogue.sigloire.fr/api/data/15468f65-921 ...@@ -40,9 +40,7 @@ parcs_eolien <- sf::st_read("https://catalogue.sigloire.fr/api/data/15468f65-921
# Jointure des 3 tables # Jointure des 3 tables
parcs_eolien_mats <- select(parcs_eolien, id_parc, nom_parc, dep, parcs_eolien_mats <- select(parcs_eolien, id_parc, nom_parc, dep) %>%
# date_crea, puissance_autorisee,puissance_en_fonctionnement, puissance_en_instruction
) %>%
st_drop_geometry() %>% st_drop_geometry() %>%
full_join(mats_eolien_1 %>% st_drop_geometry() %>% full_join(mats_eolien_1 %>% st_drop_geometry() %>%
select(id_parc, id_mat, etat_mat, en_service, date_prod, id_au, pu_nominal), select(id_parc, id_mat, etat_mat, en_service, date_prod, id_au, pu_nominal),
...@@ -62,7 +60,6 @@ parcs_eolien_mats <- select(parcs_eolien, id_parc, nom_parc, dep, ...@@ -62,7 +60,6 @@ parcs_eolien_mats <- select(parcs_eolien, id_parc, nom_parc, dep,
# table des parcs avec info sur date autorisation et de dépot # table des parcs avec info sur date autorisation et de dépot
parcs_eolien_tableau <- parcs_eolien_mats %>% parcs_eolien_tableau <- parcs_eolien_mats %>%
st_drop_geometry() %>% st_drop_geometry() %>%
# filter(etat_autorisation %in% c("Accordé", "Déposé")) %>% # à revoir
mutate(trim_depot = quarter(ymd(date_depot), type = "year.quarter"), mutate(trim_depot = quarter(ymd(date_depot), type = "year.quarter"),
trim_autorisation = if_else(substr(etat_autorisation_mat, 1, 2) == "AU", quarter(ymd(date_derniere_decision), type = "year.quarter"), NA_real_), trim_autorisation = if_else(substr(etat_autorisation_mat, 1, 2) == "AU", quarter(ymd(date_derniere_decision), type = "year.quarter"), NA_real_),
trim_mes = quarter(ymd(date_realisation), type = "year.quarter"), trim_mes = quarter(ymd(date_realisation), type = "year.quarter"),
...@@ -74,29 +71,6 @@ parcs_eolien_tableau <- parcs_eolien_mats %>% ...@@ -74,29 +71,6 @@ parcs_eolien_tableau <- parcs_eolien_mats %>%
summarise(nb_mats = n_distinct(id_mat), .groups = "drop") %>% summarise(nb_mats = n_distinct(id_mat), .groups = "drop") %>%
mutate(across(starts_with("trim_"), as.character)) mutate(across(starts_with("trim_"), as.character))
# unique(parcs_eolien_tableau$etat_autorisation)
# [1] "Sans suite" "Refusé" "Accordé" "Annulé" "Déposé"
# unique(parcs_eolien_tableau$trim_depot) %>% sort()
# [1] "2001.3" "2003.1" "2003.3" "2004.2" "2004.4" "2005.1" "2005.2" "2005.3" "2005.4" "2006.1" "2006.2" "2006.3" "2006.4" "2007.1"
# [15] "2007.2" "2007.3" "2007.4" "2008.2" "2008.3" "2008.4" "2009.2" "2009.4" "2010.1" "2010.2" "2010.3" "2010.4" "2011.4" "2012.1"
# [29] "2012.2" "2012.3" "2012.4" "2013.1" "2013.2" "2013.3" "2013.4" "2014.1" "2014.2" "2014.3" "2014.4" "2015.1" "2015.2" "2015.3"
# [43] "2015.4" "2016.1" "2016.2" "2016.3" "2016.4" "2017.1" "2017.2" "2017.3" "2017.4" "2018.1" "2018.2" "2018.3" "2018.4" "2019.2"
# [57] "2019.3" "2019.4" "2020.1" "2020.2" "2020.3" "2020.4" "2021.1" "2021.2" "2021.3" "2021.4"
# unique(parcs_eolien_tableau$trim_autorisation) %>% sort()
# [1] "2001.4" "2003.4" "2004.1" "2004.4" "2005.1" "2005.4" "2006.3" "2006.4" "2007.1" "2007.2" "2007.3" "2007.4" "2008.1" "2008.2"
# [15] "2008.3" "2008.4" "2009.1" "2009.2" "2009.3" "2009.4" "2010.2" "2010.3" "2010.4" "2011.1" "2011.2" "2011.3" "2011.4" "2012.1"
# [29] "2012.2" "2012.4" "2013.1" "2013.2" "2013.3" "2013.4" "2014.1" "2014.2" "2014.3" "2014.4" "2015.1" "2015.2" "2015.3" "2015.4"
# [43] "2016.1" "2016.2" "2016.3" "2016.4" "2017.1" "2017.2" "2017.3" "2017.4" "2018.1" "2018.2" "2018.3" "2018.4" "2019.1" "2019.2"
# [57] "2019.3" "2019.4" "2020.1" "2020.2" "2020.3" "2020.4" "2021.1" "2021.2" "2021.3" "2021.4"
# unique(parcs_eolien_tableau$trim_mes) %>% sort()
# [1] "2003.2" "2003.3" "2005.4" "2006.1" "2006.4" "2007.2" "2007.4" "2008.3" "2008.4" "2009.1" "2009.2" "2009.3" "2009.4" "2010.1"
# [15] "2010.2" "2010.3" "2010.4" "2011.1" "2011.2" "2012.1" "2012.3" "2012.4" "2013.2" "2013.4" "2014.2" "2014.4" "2015.1" "2015.2"
# [29] "2015.3" "2015.4" "2016.1" "2016.2" "2016.3" "2016.4" "2017.2" "2017.3" "2017.4" "2018.1" "2018.2" "2018.3" "2018.4" "2019.2"
# [43] "2019.3" "2019.4" "2020.1" "2020.2" "2020.3" "2020.4" "2021.3"
parcs_eolien_geom <- select(parcs_eolien, id_parc, nom_parc, exploitant) %>% parcs_eolien_geom <- select(parcs_eolien, id_parc, nom_parc, exploitant) %>%
filter(id_parc %in% parcs_eolien_tableau$id_parc) filter(id_parc %in% parcs_eolien_tableau$id_parc)
......
...@@ -61,7 +61,6 @@ function(input, output, session) { ...@@ -61,7 +61,6 @@ function(input, output, session) {
addFullscreenControl() addFullscreenControl()
}) })
# titre général des onglets ----------- # titre général des onglets -----------
output$trimestre_onglet <- renderText({ output$trimestre_onglet <- renderText({
......
...@@ -10,7 +10,7 @@ sidebarLayout( ...@@ -10,7 +10,7 @@ sidebarLayout(
mainPanel( mainPanel(
fluidPage( fluidPage(
box( box(
width = 8, width = 12,
tags$h4("Eolien terrestre source DREAL"), tags$h4("Eolien terrestre source DREAL"),
tableOutput("tableau_dreal") tableOutput("tableau_dreal")
), ),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment