Commit 158fb072 authored by Matteo DE FELICE's avatar Matteo DE FELICE

Added pumping plot

parent 947bb6cf
......@@ -48,8 +48,8 @@ shinyServer(function(input, output, session) {
mutate(avg_cost = mean(value))
g = ggplot(sel,
aes(x = date, y = source, #y = fct_reorder(source, avg_cost),
fill = cut(value, right = FALSE, breaks = seq(0, max(sel$value)+0.1, length.out = 10)))) +
aes(x = date, y = source, #y = fct_reorder(source, avg_cost),
fill = cut(value, right = FALSE, breaks = seq(0, max(sel$value)+0.1, length.out = 10)))) +
geom_tile() +
scale_fill_brewer(palette = 'YlOrRd', name = 'water value', drop = FALSE) +
ylab('Zone') +
......@@ -130,7 +130,7 @@ shinyServer(function(input, output, session) {
mutate(generation_fraction = generation / daily_total)
g = ggplot(gen_area, aes(x = date, y = generation_fraction, fill = type,
group = type)) +
group = type)) +
geom_area(size = 0.5, colour = 'black', alpha = 0.8) +
facet_wrap(~country) +
scale_fill_manual(values = color_palette) +
......@@ -197,6 +197,13 @@ shinyServer(function(input, output, session) {
mutate(day_of_the_year = yday(date)) %>%
gather(area, spillage, -date, -day_of_the_year)
pumping = readxl::read_xlsx(paste0('xls/', input$result_xls), sheet = 'Pumping') %>%
select(contains(paste0(input$zone, '_HPHS')),
contains(paste0(input$zone, '_HDAM'))) %>%
mutate(date = seq(as_datetime('2016-01-01'), by = 'day', length.out = n())) %>%
mutate(day_of_the_year = yday(date)) %>%
gather(area, pumping, -date, -day_of_the_year)
res_zone = select(res, date, contains(paste0(input$zone, '_HPHS')),
contains(paste0(input$zone, '_HDAM'))) %>%
mutate(day_of_the_year = yday(date)) %>%
......@@ -210,16 +217,18 @@ shinyServer(function(input, output, session) {
merged = inner_join(
inner_join(
inner_join(inflows, res_zone), gen_zone),
spillage) %>%
inner_join(
inner_join(inflows, res_zone), gen_zone),
spillage),
pumping) %>%
gather(variable, output, -date, -day_of_the_year, -area)
entsoe_data = entsoe_storage %>%
filter(country == input$zone)
g = ggplot(merged, aes_string(x = ifelse(diff(range(res_zone$date)) > years(1),
"date",
"day_of_the_year"),
"date",
"day_of_the_year"),
y = "output", color = "area")) +
geom_line(size = 1) +
# ylab('GWh/day') +
......
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