Skip to content

Commit 4fac04c

Browse files
committedApr 3, 2019
added r example
1 parent 5c6fe44 commit 4fac04c

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed
 
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Scenario,Total Cost,Emissions,Emission Cost,Effective Cost
2+
EUA160,36565865.34,73998.29,11839726.76,24726138.58
3+
s1 ,17449018.62,310000,1834182.25,15614836.37
4+
s2 ,17582040.87,290000,1718150.62,15863890.25
5+
s3 ,17758154.39,270000,1599613.6,16158540.79
6+
s4 ,17967819.71,250000,1482636.85,16485182.86
7+
s5 ,18226832.31,230000,1362914.56,16863917.75
8+
s6 ,18553157.49,210000,1246233.1,17306924.39
9+
s7 ,19024149.18,190000,1129364.67,17894784.51
10+
s8 ,19609195.86,170000,1009683.16,18599512.7
11+
s9 ,20269960.94,150000,891754.21,19378206.73
12+
s10 ,21065706.54,130000,774290.22,20291416.32
13+
s11 ,22048343.39,110000,658222.07,21390121.32
14+
s12,23399710.17,90000,540872.81,22858837.36
15+
s13,25866808.68,70000,423623.79,25443184.89
16+
s14,33875183.48,50000,303411.2,33571772.28
4.95 KB
Binary file not shown.
77.1 KB
Loading

‎session3_r/scripts/emissions_figure.R

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
library(tidyverse)
2+
library(ggplot)
3+
4+
### Set Working Directory - works in R-Studio only
5+
scriptDir<-dirname(rstudioapi::getActiveDocumentContext()$path)
6+
setwd(paste0(scriptDir,"/../"))
7+
8+
tab<-read_csv("data/results_ubrmskript.csv")
9+
10+
tab<-tab %>%
11+
mutate(diff=c(tab$`Effective Cost`[-1],0)-`Effective Cost`)
12+
13+
points<-tab %>%
14+
filter(Scenario %in% c("EUA160","s8")) %>%
15+
mutate(Szenario=Scenario)
16+
17+
18+
points$Szenario<-c("160Euro CO2-Preis","170 Millionen tCO2 Limit")
19+
20+
erc_colors<-c("#C72321","#6E9B9E")
21+
22+
tab %>%
23+
ggplot(aes(x=Emissions/1000,y=`Effective Cost`/10^6)) +
24+
geom_line() +
25+
geom_point() +
26+
theme_bw() +
27+
xlab("Emissionen (Millionen tCO2/Jahr)") +
28+
ylab("Brennstoff- und Kapitalkosten des Stromsystems (Milliarden Euro/Jahr)")+
29+
geom_point(data=points,aes(x=Emissions/1000,y=`Effective Cost`/10^6,col=Szenario,shape=Szenario),size=5)+
30+
scale_color_manual(values=c(erc_colors,erc_colors))
31+
32+
33+
ggsave("figures/figure_multi_objective.png")
34+
ggsave("figures/figure_multi_objective.pdf")

0 commit comments

Comments
 (0)
Please sign in to comment.