prodStack: Visualize the production stack of an area

Description Usage Arguments Details Value See Also Examples

Description

prodStack draws the production stack for a set of areas or districts. User can see available stacks with prodStackAliases and create new ones with setProdStackAlias.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
prodStackAliases()

setProdStackAlias(name, variables, colors, lines = NULL, lineColors = NULL,
  description = NULL)

prodStack(x, stack = "eco2mix", areas = NULL, mcYear = "average",
  dateRange = NULL, main = "Production stack", unit = c("MWh", "GWh",
  "TWh"), compare = NULL, compareOpts = list(),
  interactive = getInteractivity(), legend = TRUE,
  legendId = sample(1e+09, 1), groupId = legendId, legendItemsPerRow = 5,
  width = NULL, height = NULL, xyCompare = c("union", "intersect"),
  h5requestFiltering = list(), stepPlot = FALSE, drawPoints = FALSE,
  timeSteph5 = "hourly", mcYearh5 = NULL, tablesh5 = c("areas", "links"),
  ...)

Arguments

name

name of the stack to create or update

variables

A named list of expressions created with alist. The name of each element is the name of the variable to draw in the stacked graph. The element itself is an expression explaining how to compute the variable (see examples).

colors

Vector of colors with same length as parameter variables. If variables is an alias, then this argument should be NULL in order to use default colors.

lines

A named list of expressions created with alist indicating how to compute the curves to display on top of the stacked graph. It should be NULL if there is no curve to trace or if parameter variables is an alias.

lineColors

Vector of colors with same length as parameter lines. This argument should be NULL if there is no curve to trace or if parameter variables is an alias.

description

Description of the stack. It is displayed by function prodStackAliases.

x

An object of class antaresData created with function readAntares containing data for areas and or districts. it can be a list of antaresData objects. In this case, one chart is created for each object. Can also contains opts who refer to a h5 file or list of opts.

stack

Name of the stack to use. One can visualize available stacks with prodStackAliases

areas

Vector of area or district names. The data of these areas or districts is aggregated by the function to construct the production stack.

mcYear

If x, contains multiple Monte-Carlo scenarios, this parameter determine which scenario is displayed. Must be an integer representing the index of the scenario or the word "average". In this case data are averaged.

dateRange

A vector of two dates. Only data points between these two dates are displayed. If NULL, then all data is displayed.

main

Title of the graph.

unit

Unit used in the graph. Possible values are "MWh", "GWh" or "TWh".

compare

An optional character vector containing names of parameters. When it is set, two charts are outputed with their own input controls. Alternatively, it can be a named list with names corresponding to parameter names and values being list with the initial values of the given parameter for each chart. See details if you are drawing a map.

compareOpts

List of options that indicates the number of charts to create and their position. Check out the documentation of compareOptions to see available options.

interactive

LogicalValue. If TRUE, then a shiny gadget is launched that lets the user interactively choose the areas or districts to display.

legend

Logical value indicating if a legend should be drawn. This argument is usefull when one wants to create a shared legend with prodStackLegend

legendId

Id of the legend linked to the graph. This argument is usefull when one wants to create a shared legend with prodStackLegend

groupId

Parameter that can be used to synchronize the horizontal zoom of multiple charts. All charts that need to be synchronized must have the same group.

legendItemsPerRow

Number of elements to put in each row of the legend.

width

Width of the graph expressed in pixels or in percentage of the parent element. For instance "500px" and "100%" are valid values.

height

Height of the graph expressed in pixels or in percentage of the parent element. For instance "500px" and "100%" are valid values.

xyCompare

Use when you compare studies, can be "union" or "intersect". If union, all of mcYears in one of studies will be selectable. If intersect, only mcYears in all studies will be selectable.

h5requestFiltering

Contains arguments used by default for h5 request, typically h5requestFiltering = list(select = "NUCLEAR")

stepPlot

boolean, step style for curves.

drawPoints

boolean, add points on graph

timeSteph5

character timeStep to read in h5 file. Only for Non interactive mode.

mcYearh5

numeric mcYear to read for h5. Only for Non interactive mode.

tablesh5

character tables for h5 ("areas" "links", "clusters" or "disticts"). Only for Non interactive mode.

...

Other arguments for manipulateWidget

Details

compare argument can take following values :

Value

prodStack returns an interactive html graphic. If argument interactive is TRUE, then a shiny gadget is started and the function returns an interactive html graphic when the user clicks on button "Done".

prodStackAliases displays the list of available aliases.

setProdStackAlias creates or updates a stack alias.

See Also

prodStackLegend

Examples

 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
## Not run: 
mydata <- readAntares(areas = "all", timeStep = "daily")

# Start a shiny gadget that permits to choose areas to display.
prodStack(x = mydata, unit = "GWh")

# Use in a non-interactive way
prodStack(x = mydata, unit = "GWh", areas = "fr", interactive = FALSE)

# Define a custom stack
setProdStackAlias(
  name = "Wind and solar",
  variables = alist(wind = WIND, solar = SOLAR),
  colors = c("green", "orange")
)

prodStack(x = mydata, unit = "GWh", stack = "Wind and solar")
                
# In a custom stack it is possible to use computed values
setProdStackAlias(
  name = "Renewable",
  variables = alist(
    renewable = WIND + SOLAR + `H. ROR` + `H. STOR` + `MISC. NDG`, 
    thermal = NUCLEAR + LIGNITE + COAL + GAS + OIL + `MIX. FUEL` + `MISC. DTG`
  ),
  colors = c("green", gray(0.3)),
  lines = alist(goalRenewable = LOAD * 0.23),
  lineColors = "#42EB09"
)

prodStack(x = mydata, unit = "GWh", stack = "renewable")

# Use compare
prodStack(x = mydata, compare = "areas")
prodStack(x = mydata, unit = "GWh", compare = "mcYear")
prodStack(x = mydata, unit = "GWh", compare = "main")
prodStack(x = mydata, unit = "GWh", compare = "unit")
prodStack(x = mydata, unit = "GWh", compare = "areas")
prodStack(x = mydata, unit = "GWh", compare = "legend")
prodStack(x = mydata, unit = "GWh", compare = "stack")
prodStack(x = mydata, unit = "GWh", compare = c("mcYear", "areas"))


# Compare studies
prodStack(list(mydata, mydata))


# Use h5 opts
# Set path of simulaiton
setSimulationPath(path = path1)

# Convert your study in h5 format
writeAntaresH5(path = mynewpath)

# Redefine sim path with h5 file
opts <- setSimulationPath(path = mynewpath)
prodStack(x = opts)

# Compare elements in a single study
prodStack(x = opts, .compare = "mcYear")

# Compare 2 studies
prodStack(x = list(opts, opts2))


                

## End(Not run)

rte-antares-rpackage/bpN documentation built on May 31, 2019, 2:52 p.m.