Skip to content
Snippets Groups Projects
Commit 9dbf478b authored by Antoine Levesque's avatar Antoine Levesque
Browse files

Merge branch 'develop' of https://github.com/piklev/remind into develop

parents c5110703 2bf7ad62
No related branches found
No related tags found
1 merge request!154*refactoring* changed the efficiency plots in the calibration reporting
...@@ -108,10 +108,11 @@ col <- c("#fc0000", "#000000", ...@@ -108,10 +108,11 @@ col <- c("#fc0000", "#000000",
"#bc80bd"#, "#bc80bd"#,
#"#808080" #"#808080"
) )
names(col) <- c("origin", "target", seq(1,length(itr_num)))
lns <- c(rep("solid", 2), rep("longdash", length(itr_num))) lns <- c(rep("solid", 2), rep("longdash", length(itr_num)))
names(lns) <- c("origin", "target", seq(1,length(itr_num)))
.pf <- list("TE" = c("gastr", "refliq", "biotr", "coaltr","hydro", "ngcc","ngt","pc", "apCarDiT","apCarPeT","apCarElT","dot","gaschp","wind","tnrs")) .pf <- list("TE" = c("gastr", "refliq", "biotr", "coaltr","hydro", "ngcc","ngt","pc", "apCarDiT","apCarPeT","apCarElT","dot","gaschp","wind","tnrs"))
...@@ -202,8 +203,8 @@ for (s in levels(CES.cal.report$scenario)) { ...@@ -202,8 +203,8 @@ for (s in levels(CES.cal.report$scenario)) {
geom_line() + geom_line() +
facet_wrap(~ pf, scales = "free", as.table = FALSE) + facet_wrap(~ pf, scales = "free", as.table = FALSE) +
expand_limits(y = 0) + expand_limits(y = 0) +
scale_colour_manual(values = col[-2]) + scale_colour_manual(values = col) +
scale_linetype_manual(values = lns[-2]) + scale_linetype_manual(values = lns) +
ggtitle(paste("prices", r, s)) -> p ggtitle(paste("prices", r, s)) -> p
plot(p) plot(p)
...@@ -212,17 +213,22 @@ for (s in levels(CES.cal.report$scenario)) { ...@@ -212,17 +213,22 @@ for (s in levels(CES.cal.report$scenario)) {
filter(scenario == s, filter(scenario == s,
t <= 2100, t <= 2100,
regi == r, regi == r,
variable == "total efficiency") %>% variable == "total efficiency",
iteration != "origin") %>%
group_by(scenario,t,regi,pf,variable) %>%
mutate(value = value / value[as.character(iteration) == "1"]) %>%
ungroup() %>%
order.levels(pf = getElement(.pf,"structure" )) %>% order.levels(pf = getElement(.pf,"structure" )) %>%
ggplot(aes(x = t, y = value, colour = iteration, ggplot(aes(x = t, y = value, colour = iteration,
linetype = iteration)) + linetype = iteration)) +
geom_line() + geom_line() +
facet_wrap(~ pf, scales = "free", as.table = FALSE) + facet_wrap(~ pf, scales = "free", as.table = FALSE) +
expand_limits(y = 0) + scale_colour_manual(values = col) +
scale_colour_manual(values = col[-2]) + scale_linetype_manual(values = lns) +
scale_linetype_manual(values = lns[-2]) + ggtitle(paste("total efficiency (1 = iteration 1)", r, s)) -> p
ggtitle(paste("total efficiency", r, s)) -> p
plot(p) plot(p)
# plot Putty quantities # plot Putty quantities
if ( dim(CES.cal.report %>% filter(variable == "quantity_putty"))[1] > 0){ if ( dim(CES.cal.report %>% filter(variable == "quantity_putty"))[1] > 0){
CES.cal.report %>% CES.cal.report %>%
...@@ -254,8 +260,8 @@ for (s in levels(CES.cal.report$scenario)) { ...@@ -254,8 +260,8 @@ for (s in levels(CES.cal.report$scenario)) {
geom_line() + geom_line() +
facet_wrap(~ pf, scales = "free", as.table = FALSE) + facet_wrap(~ pf, scales = "free", as.table = FALSE) +
expand_limits(y = 0) + expand_limits(y = 0) +
scale_colour_manual(values = col[-2]) + scale_colour_manual(values = col) +
scale_linetype_manual(values = lns[-2]) + scale_linetype_manual(values = lns) +
ggtitle(paste("prices", r, s)) -> p ggtitle(paste("prices", r, s)) -> p
plot(p) plot(p)
...@@ -264,16 +270,20 @@ for (s in levels(CES.cal.report$scenario)) { ...@@ -264,16 +270,20 @@ for (s in levels(CES.cal.report$scenario)) {
filter(scenario == s, filter(scenario == s,
t <= 2100, t <= 2100,
regi == r, regi == r,
variable == "total efficiency putty") %>% variable == "total efficiency putty",
iteration != "origin") %>%
group_by(scenario,t,regi,pf,variable) %>%
mutate(value = value / value[as.character(iteration) == "1"]) %>%
ungroup() %>%
order.levels(pf = getElement(.pf,"structure" )) %>% order.levels(pf = getElement(.pf,"structure" )) %>%
ggplot(aes(x = t, y = value, colour = iteration, ggplot(aes(x = t, y = value, colour = iteration,
linetype = iteration)) + linetype = iteration)) +
geom_line() + geom_line() +
facet_wrap(~ pf, scales = "free", as.table = FALSE) + facet_wrap(~ pf, scales = "free", as.table = FALSE) +
expand_limits(y = 0) + expand_limits(y = 0) +
scale_colour_manual(values = col[-2]) + scale_colour_manual(values = col) +
scale_linetype_manual(values = lns[-2]) + scale_linetype_manual(values = lns) +
ggtitle(paste("total efficiency", r, s)) -> p ggtitle(paste("total efficiency (1 = iteration 1)", r, s)) -> p
plot(p) plot(p)
} }
...@@ -297,8 +307,8 @@ for (s in levels(CES.cal.report$scenario)) { ...@@ -297,8 +307,8 @@ for (s in levels(CES.cal.report$scenario)) {
geom_line() + geom_line() +
facet_wrap(~ pf, scales = "free", as.table = FALSE) + facet_wrap(~ pf, scales = "free", as.table = FALSE) +
expand_limits(y = 0) + expand_limits(y = 0) +
scale_colour_manual(values = col[-2]) + scale_colour_manual(values = col) +
scale_linetype_manual(values = lns[-2]) + scale_linetype_manual(values = lns) +
geom_vline(xintercept = 2005) + geom_vline(xintercept = 2005) +
ggtitle(paste("vm_deltaCap", r, s)) -> p ggtitle(paste("vm_deltaCap", r, s)) -> p
plot(p) plot(p)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment