# 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))
# Compare studies with refStudy argument
prodStack(x = myData1, refStudy = myData2)
prodStack(x = myData1, refStudy = myData2, interactive = FALSE)
prodStack(x = list(myData2, myData3, myData4), refStudy = myData1)
prodStack(x = list(myData2, myData3, myData4), refStudy = myData1, interactive = FALSE)
# 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))
# Compare 2 studies with argument refStudies
prodStack(x = opts, refStudy = opts2)
prodStack(x = opts, refStudy = opts2, interactive = FALSE, mcYearh5 = 2, areas = myArea)
prodStack(x = opts, refStudy = opts2, h5requestFiltering = list(areas = myArea,
mcYears = 2))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab