# NOT RUN {
setSimulationPath(path = path1)
mydata <- readAntares(areas = "all", timeStep = "hourly")
plot(x = mydata)
# Plot only a few areas
plot(x = mydata[area %in% c("area1", "area2", "area3")])
# If data contains detailed results, then the function adds a confidence
# interval
dataDetailed <- readAntares(areas = "all", timeStep = "hourly", mcYears = 1:2)
plot(x = dataDetailed)
# If the time step is annual, the function creates a barplot instead of a
# linechart
dataAnnual <- readAntares(areas = "all", timeStep = "annual")
plot(x = dataAnnual)
# Compare two simulaitons
# Compare the results of two simulations
setSimulationPath(path1)
mydata1 <- readAntares(areas = "all", timeStep = "daily")
setSimulationPath(path2)
mydata2 <- readAntares(areas = "all", timeStep = "daily")
plot(x = list(mydata1, mydata2))
# When you compare studies, you have 2 ways to defind inputs, union or intersect.
# for example, if you chose union and you have mcYears 1 and 2 in the first study
# and mcYears 2 and 3 in the second, mcYear input will be worth c(1, 2, 3)
# In same initial condition (study 1 -> 1,2 ans study 2 -> 2, 3) if you choose intersect,
# mcYear input will be wort 2.
# You must specify union or intersect with xyCompare argument (default union).
plot(x = list(mydata1[area %in% c("a", "b")],
mydata1[area %in% c("b", "c")]), xyCompare = "union")
plot(x = list(mydata1[area %in% c("a", "b")],
mydata1[area %in% c("b", "c")]), xyCompare = "intersect")
# Compare data in a single simulation
# Compare two periods for the same simulation
plot(x = mydata1, compare = "dateRange")
# Compare two Monte-Carlo scenarios
detailedData <- readAntares(areas = "all", mcYears = "all")
plot(x = detailedData, .compare = "mcYear")
# Use h5 for dynamic request / exploration in a study
# 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)
plot(x = opts)
# Compare elements in a single study
plot(x = opts, .compare = "mcYear")
# Compare 2 studies
plot(x = list(opts, opts2))
# Compare 2 studies with argument refStudy
plot(x = opts, refStudy = opts2)
plot(x = opts, refStudy = opts2, type = "ts", interactive = FALSE, mcYearh5 = 2)
plot(x = opts, refStudy = opts2, type = "ts", dateRange = DR, h5requestFiltering = list(
mcYears = mcYears = mcYearToTest))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab