Description Usage Arguments Details Value Examples
This function generates an interactive plot of an antares time series.
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 | tsPlot(x, table = NULL, variable = NULL, elements = NULL,
variable2Axe = NULL, mcYear = "average", type = c("ts", "barplot",
"monotone", "density", "cdf", "heatmap"), dateRange = NULL, confInt = 0,
minValue = NULL, maxValue = NULL, aggregate = c("none", "mean", "sum",
"mean by areas", "sum by areas"), compare = NULL, compareOpts = list(),
interactive = getInteractivity(), colors = NULL, main = NULL,
ylab = NULL, legend = TRUE, legendItemsPerRow = 5,
colorScaleOpts = colorScaleOptions(20), width = NULL, height = NULL,
xyCompare = c("union", "intersect"), h5requestFiltering = list(),
highlight = FALSE, stepPlot = FALSE, drawPoints = FALSE,
secondAxis = FALSE, timeSteph5 = "hourly", mcYearh5 = NULL,
tablesh5 = c("areas", "links"), ...)
## S3 method for class 'antaresData'
plot(x, table = NULL, variable = NULL,
elements = NULL, variable2Axe = NULL, mcYear = "average",
type = c("ts", "barplot", "monotone", "density", "cdf", "heatmap"),
dateRange = NULL, confInt = 0, minValue = NULL, maxValue = NULL,
aggregate = c("none", "mean", "sum", "mean by areas", "sum by areas"),
compare = NULL, compareOpts = list(), interactive = getInteractivity(),
colors = NULL, main = NULL, ylab = NULL, legend = TRUE,
legendItemsPerRow = 5, colorScaleOpts = colorScaleOptions(20),
width = NULL, height = NULL, xyCompare = c("union", "intersect"),
h5requestFiltering = list(), highlight = FALSE, stepPlot = FALSE,
drawPoints = FALSE, secondAxis = FALSE, timeSteph5 = "hourly",
mcYearh5 = NULL, tablesh5 = c("areas", "links"), ...)
## S3 method for class 'simOptions'
plot(x, table = NULL, variable = NULL,
elements = NULL, variable2Axe = NULL, mcYear = "average",
type = c("ts", "barplot", "monotone", "density", "cdf", "heatmap"),
dateRange = NULL, confInt = 0, minValue = NULL, maxValue = NULL,
aggregate = c("none", "mean", "sum", "mean by areas", "sum by areas"),
compare = NULL, compareOpts = list(), interactive = getInteractivity(),
colors = NULL, main = NULL, ylab = NULL, legend = TRUE,
legendItemsPerRow = 5, colorScaleOpts = colorScaleOptions(20),
width = NULL, height = NULL, xyCompare = c("union", "intersect"),
h5requestFiltering = list(), highlight = FALSE, stepPlot = FALSE,
drawPoints = FALSE, secondAxis = FALSE, timeSteph5 = "hourly",
mcYearh5 = NULL, tablesh5 = c("areas", "links"), ...)
## S3 method for class 'list'
plot(x, table = NULL, variable = NULL, elements = NULL,
variable2Axe = NULL, mcYear = "average", type = c("ts", "barplot",
"monotone", "density", "cdf", "heatmap"), dateRange = NULL, confInt = 0,
minValue = NULL, maxValue = NULL, aggregate = c("none", "mean", "sum",
"mean by areas", "sum by areas"), compare = NULL, compareOpts = list(),
interactive = getInteractivity(), colors = NULL, main = NULL,
ylab = NULL, legend = TRUE, legendItemsPerRow = 5,
colorScaleOpts = colorScaleOptions(20), width = NULL, height = NULL,
xyCompare = c("union", "intersect"), h5requestFiltering = list(),
highlight = FALSE, stepPlot = FALSE, drawPoints = FALSE,
secondAxis = FALSE, timeSteph5 = "hourly", mcYearh5 = NULL,
tablesh5 = c("areas", "links"), ...)
|
x |
Object of class |
table |
Name of the table to display when |
variable |
Name of the variable to plot. If this argument is missing, then the function starts a shiny gadget that let the user choose the variable to represent. When the user clicks on the "Done" button", the graphic is returned by the function. |
elements |
Vector of "element" names indicating for which elements of 'x' should the
variable be plotted. For instance if the input data contains areas, then
this parameter should be a vector of area names. If data contains clusters
data, this parameter has to be the concatenation of the area name and the
cluster name, separated by |
variable2Axe |
|
mcYear |
If |
type |
Type of plot to draw. "ts" creates a time series plot, "barplot" creates a barplot with one bar per element representing the average value of the variable for this element. "monotone" draws the monotone curve of the variable for each element. |
dateRange |
A vector of two dates. Only data points between these two dates are displayed. If NULL, then all data is displayed. |
confInt |
Number between 0 and 1 indicating the size of the confidence interval to display. If it equals to 0, then confidence interval is not computed nor displayed. Used only when multiple Monte Carlo scenarios are present in the input data. |
minValue |
Only used if parameter |
maxValue |
Only used if parameter |
aggregate |
When multiple elements are selected, should the data be aggregated. If "none", each element is represented separetly. If "mean" values are averaged and if "sum" they are added. You can also compute mean ans sum by areas. |
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
|
interactive |
LogicalValue. If |
colors |
Vector of colors |
main |
Title of the graph. |
ylab |
Label of the Y axis. |
legend |
Logical value indicating if a legend should be drawn. This argument is
usefull when one wants to create a shared legend with
|
legendItemsPerRow |
Number of elements to put in each row of the legend. |
colorScaleOpts |
A list of parameters that control the creation of color scales. It is used
only for heatmaps. See |
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") |
highlight |
highlight curve when mouse over |
stepPlot |
|
drawPoints |
|
secondAxis |
add second axis to graph |
timeSteph5 |
|
mcYearh5 |
|
tablesh5 |
|
... |
Other arguments for |
If the input data contains several Monte-Carlo scenarios, the function will display the evolution of the average value. Moreover it will represent a 95
If the input data has a annual time step, the function creates a barplot instead of a line chart.
compare argument can take following values :
"mcYear"
"main"
"variable"
"type"
"confInt"
"elements"
"aggregate"
"legend"
"highlight"
"stepPlot"
"drawPoints"
"secondAxis"
The function returns an object of class "htmlwidget". It is generated by
package highcharter
if time step is annual or by dygraphs
for
any other time step.It can be directly displayed in the viewer or be stored
in a variable for later use.
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 | ## 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))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.