Description Usage Arguments Value Examples
View source: R/compare_options.R
This function generates a list of options that are used by
manipulateWidget
to compare multiple charts.
1 |
ncharts |
Number of charts to generate. |
nrow |
Number of rows. If |
ncol |
Number of columns. If |
allowCompare |
If |
List of options
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 | if (require(dygraphs)) {
mydata <- data.frame(
year = 2000+1:100,
series1 = rnorm(100),
series2 = rnorm(100),
series3 = rnorm(100)
)
manipulateWidget(
dygraph(mydata[range[1]:range[2] - 2000, c("year", series)], main = title),
range = mwSlider(2001, 2100, c(2001, 2100)),
series = mwSelect(c("series1", "series2", "series3")),
title = mwText("Fictive time series"),
.compare = list(title = NULL, series = NULL),
.compareOpts = compareOptions(ncharts = 4)
)
manipulateWidget(
dygraph(mydata[range[1]:range[2] - 2000, c("year", series)], main = title),
range = mwSlider(2001, 2100, c(2001, 2100)),
series = mwSelect(c("series1", "series2", "series3")),
title = mwText("Fictive time series"),
.compare = list(title = NULL, series = NULL),
.compareOpts = compareOptions(ncharts = 3, nrow = 3)
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.