Commit 4645d20f authored by Matteo DE FELICE's avatar Matteo DE FELICE

Added the possibility to show the LOSTLOAD as a slack

parent 986b57c9
...@@ -24,9 +24,10 @@ shinyServer(function(input, output, session) { ...@@ -24,9 +24,10 @@ shinyServer(function(input, output, session) {
wv = readxl::read_xlsx(paste0('', input$result_xls), sheet = 'Water value') %>% wv = readxl::read_xlsx(paste0('', input$result_xls), sheet = 'Water value') %>%
mutate(date = seq(as_datetime('2016-01-01'), by = 'day', length.out = n())) mutate(date = seq(as_datetime('2016-01-01'), by = 'day', length.out = n()))
pf = readxl::read_xlsx(paste0('', input$result_xls), sheet = 'Power flow') %>% pf = readxl::read_xlsx(paste0('', input$result_xls), sheet = 'Power flow') %>%
mutate(date = seq(as_datetime('2016-01-01'), by = 'day', length.out = n())) mutate(date = seq(as_datetime('2016-01-01'), by = 'day', length.out = n()))
ll = readxl::read_xlsx(paste0('', input$result_xls), sheet = 'LOSTLOAD') %>%
mutate(date = seq(as_datetime('2016-01-01'), by = 'day', length.out = n()))
# Load ENTSOE Data # Load ENTSOE Data
entsoe_storage = read_rds('data/ENTSOE-Storage-2015-2018.rds') entsoe_storage = read_rds('data/ENTSOE-Storage-2015-2018.rds')
...@@ -114,10 +115,15 @@ shinyServer(function(input, output, session) { ...@@ -114,10 +115,15 @@ shinyServer(function(input, output, session) {
'OIL' = 'brown', 'OIL' = 'brown',
'ICEN' = 'grey66', 'ICEN' = 'grey66',
'HRD' = 'black', 'HRD' = 'black',
'LOSTLOAD' = 'grey75',
'ZZZ' = 'grey75', 'ZZZ' = 'grey75',
'slack' = 'grey75') 'slack' = 'grey75')
# Add lost load information
sel_ll = ll %>%
select(input$zone) %>% pull()
g = sel_zone %>% g = sel_zone %>%
mutate(SELECTED_LOSTLOAD = sel_ll) %>%
gather(source, generation, -date) %>% gather(source, generation, -date) %>%
mutate(source_type = str_split(source, '_', simplify = TRUE)[,2]) %>% mutate(source_type = str_split(source, '_', simplify = TRUE)[,2]) %>%
group_by(date, source_type) %>% group_by(date, source_type) %>%
...@@ -157,9 +163,12 @@ shinyServer(function(input, output, session) { ...@@ -157,9 +163,12 @@ shinyServer(function(input, output, session) {
'OIL' = 'brown', 'OIL' = 'brown',
'ICEN' = 'grey66', 'ICEN' = 'grey66',
'HRD' = 'black', 'HRD' = 'black',
'LOSTLOAD' = 'grey75',
'ZZZ' = 'grey75') 'ZZZ' = 'grey75')
gen_area = gen %>% gen_area = gen %>%
select(-X__1) %>% select(-X__1) %>%
bind_cols(ll %>% select(-X__1, -date) %>% select_all(.funs = funs(paste0(., "_LOSTLOAD"))) ) %>%
gather(zone, generation, -date) %>% gather(zone, generation, -date) %>%
mutate(country = str_split(zone, '_', simplify = TRUE)[,1], mutate(country = str_split(zone, '_', simplify = TRUE)[,1],
type = str_split(zone, '_', simplify = TRUE)[,2], type = str_split(zone, '_', simplify = TRUE)[,2],
......
Markdown is supported
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