plot.fts: Functional Time Series Visualization Tools Using Plotly

Description Usage Arguments Note Examples

View source: R/ftsplot.r

Description

This is a plotting method for univariate or multivariate functional time series (fts). This method is designed to help the user visualize fts data using a variety of techniques that use plotly.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## S3 method for class 'fts'
plot(
  Y,
  type1 = "line",
  type2 = "heatmap",
  main = NULL,
  ylab = "y",
  xlab = "x",
  tlab = "t",
  zlab = "z",
  obs = 1,
  vars = NULL,
  ...
)

Arguments

main

the main title

ylab

the y-axis label

xlab

the x-axis label

tlab

the time-axis label

...

arguments to be passed to methods, such as graphical parameters.

x

an object of class fts

type

the type of plot to be displayed where possible types are:

  • "line" plot the fts elements in a line plot (default)

  • "heatmap" plot the fts elements in a heat map

  • "3Dsurface" plot the fts elements as a surface

  • "3Dline" plot the fts elements in a three-dimensional line plot

npts

number of points to evaluate functional object at

var

an integer specifying the variable number to plot if type="3Dsurface" or type="3Dline"

Note

for a multivariate example, see the examples in fssa

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
require(fda)
require(Rfssa)
data(Callcenter) # Read data
u=seq(0,1,length.out=240) # Define domain of functional data
d=12 # number of basis elements
basis=create.bspline.basis(rangeval = c(0,1),nbasis = d) # create basis object
smooth.calls=smooth.basis(u, matrix(nrow=240,ncol=365,Callcenter$calls), basis)
Y=fts(smooth.calls$fd) # create functional time series
plot(Y,type = "heatmap")
plot(Y,type = "line",var = 1)
plot(Y,type = "3Dsurface",var = 1)
plot(Y,type = "3Dline",var = 1)

## End(Not run)

jtrinka/Rfssa_dev documentation built on Dec. 21, 2021, 4:14 a.m.