plot.DTSg | R Documentation |
Displays an interactive plot of a DTSg
object. This method requires
dygraphs and RColorBrewer to be installed. Its main purpose is
not to make pretty plots, but rather to offer a possibility to interactively
explore time series data. The title of the plot and the label of its primary
axis are automatically generated from the object's metadata (fields). See
DTSg
for further information.
## S3 method for class 'DTSg'
plot(
x,
from = first(self$values(reference = TRUE)[[".dateTime"]]),
to = last(self$values(reference = TRUE)[[".dateTime"]]),
cols = self$cols(class = "numeric"),
secAxisCols = NULL,
secAxisLabel = "",
...
)
x |
A |
from |
A |
to |
A |
cols |
A character vector specifying the columns whose values shall be
plotted. Another possibility is a character string containing either comma
separated column names, for example, |
secAxisCols |
An optional character vector specifying the columns whose
values shall be plotted on a secondary axis. Another possibility is a
character string containing either comma separated column names, for
example, |
secAxisLabel |
A character string specifying the label of the optional secondary axis. |
... |
Not used (S3 method only). |
Returns a DTSg
object.
cols
# new DTSg object
x <- DTSg$new(values = flow)
# plot data
if (requireNamespace("dygraphs", quietly = TRUE) &&
requireNamespace("RColorBrewer", quietly = TRUE)) {
## R6 method
x$plot()
## S3 method
plot(x = x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.