-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathantaresViz-0.15.Rmd
158 lines (114 loc) · 4.51 KB
/
antaresViz-0.15.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
---
title: "antaresViz 0.15"
author: "Jalal-Edine ZAWAM"
date: "25 september 2018"
output:
html_document:
number_sections: yes
toc: yes
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(out.width='100%')
library(antaresViz)
```
# Introduction
`antaresViz-0.15` is on CRAN. It includes new features. This document introduces some of them.
Install `antaresViz` with :
```{r installAntaresViz, echo = TRUE, eval = FALSE}
install.packages("antaresViz")
```
# Reference study
`runAppAntaresViz()` run a shiny app. You can now use a reference study in your analysis process. Someone can now compare several strategies from a reference study. This process use the function 'antaresProcessing::compare'.
You can find the description of compare [here](https://cran.r-project.org/web/packages/antaresProcessing/antaresProcessing.pdf#compare).
![](inst/dataViz/refStudy.gif)
# Reference study with interactive set to FALSE
You can also use a reference study outside the shiny app. `prodStack()`, `exchangesStack`, `plot` and `plotMap` have a new parameter `refStudy` to set the reference study.
```{r importData, echo=FALSE, message=FALSE}
#here import data
refStudy <- "E:\\ANTARES\\h5_BP\\LTA26_mcind_filter.h5"
alternative1 <- "E:\\ANTARES\\h5_BP\\LTB26_mcind_filter.h5"
alternative2 <- "E:\\ANTARES\\h5_BP\\LTC26_mcind_filter.h5"
mlLayout <- readRDS("E:\\ANTARES\\Exemple_antares/mapLayout/BP_ml.RDS")
optsRef <- setSimulationPath(path = refStudy)
refData <- readAntares(areas = "all",
links = "all",
opts = optsRef)
optsAlter1 <- setSimulationPath(path = alternative1)
myData01 <- readAntares(areas = "all",
links = "all",
opts = optsAlter1)
optsAlter2 <- setSimulationPath(path = alternative2)
myData02 <- readAntares(areas = "all",
links = "all",
opts = optsAlter2)
```
Import your data before comparing.
```{r importDataFake, echo = TRUE, eval = FALSE}
#here import your data
refStudy <- "pathToRefStudy"
mlLayout <- load("myLayout")
#reference study
optsRef <- setSimulationPath(path = refStudy, simulation = -3)
refData <- readAntares(areas = "all",
links = "all",
opts = optsRef)
#strategie 1
optsAlter1 <- setSimulationPath(path = refStudy, simulation = -2)
myData01 <- readAntares(areas = "all",
links = "all",
opts = optsRef)
#strategie 2
optsAlter2 <- setSimulationPath(path = refStudy, simulation = -1)
myData02 <- readAntares(areas = "all",
links = "all",
opts = optsRef)
```
## prodStack
We can compare easily the production between the strategies and the reference study.
For example, for strategy one, we produce more gas than the reference study and less nuclear.
```{r prodStack, echo = TRUE, eval = TRUE}
myDataRange <- c("2029-01-09 00:00:00",
"2029-01-16 00:00:00")
prodStack(x = list(myData01, myData02),
refStudy = refData,
interactive = FALSE,
areas = "fr",
dateRange = myDataRange)
```
## exchangesStack
Flows can be very different between the two strategies.
What is the best strategy for exporting more in January?
```{r exchangesStack, echo = TRUE, eval = TRUE}
exchangesStack(x = list(myData01, myData02),
refStudy = refData,
interactive = FALSE,
area = "fr",
dateRange = myDataRange)
```
## plotMap
You can also compare the production and flows evolutions on a map.
```{r plotMapRef, echo = TRUE, eval = TRUE, out.width='100%', fig.height=8}
plotMap(x = list(myData01, myData02),
refStudy = refData,
mapLayout = mlLayout,
type = "avg",
interactive = FALSE,
colAreaVar = "LOAD",
typeSizeAreaVars = TRUE,
aliasSizeAreaVars = c("generation", "renewable"),
colLinkVar = "CONG. PROB +",
sizeLinkVar = "FLOW LIN.",
sizeMiniPlot = TRUE)
```
## plot
We can also focus our attention on the evolution of a variable.
```{r tsPlot, echo = TRUE, eval = TRUE}
plot(x = list(myData01, myData02),
refStudy = refData,
interactive = FALSE,
elements = "fr",
table = "areas",
variable = "NUCLEAR",
type = "density")
```