ts_plot: Plotting Time Series Objects

View source: R/ts_plot.R

ts_plotR Documentation

Plotting Time Series Objects

Description

Visualization functions for time series object

Usage

ts_plot(ts.obj, line.mode = "lines", width = 2, dash = NULL,
  color = NULL, slider = FALSE, type = "single", Xtitle = NULL,
  Ytitle = NULL, title = NULL, Xgrid = FALSE, Ygrid = FALSE)

Arguments

ts.obj

A univariate or multivariate time series object of class "ts", "mts", "zoo", "xts", or any data frame object with a minimum of one numeric column and either a Date or POSIXt class column

line.mode

A plotly argument, define the plot type, c("lines", "lines+markers", "markers")

width

An Integer, define the plot width, default is set to 2

dash

A plotly argument, define the line style, c(NULL, "dot", "dash")

color

The color of the plot, support both name and expression

slider

Logic, add slider to modify the time axis (default set to FALSE)

type

A character, optional, if having multiple tims series object, will plot all series in one plot when set to "single" (default), or plot each series on a separate plot when set to "multiple"

Xtitle

A character, set the X axis title, default set to NULL

Ytitle

A character, set the Y axis title, default set to NULL

title

A character, set the plot title, default set to NULL

Xgrid

Logic,show the X axis grid if set to TRUE

Ygrid

Logic,show the Y axis grid if set to TRUE

Examples

data(USVSales)
ts_plot(USVSales)

# adding slider
ts_plot(USVSales, slider = TRUE)

TSstudio documentation built on Aug. 9, 2023, 9:06 a.m.