Learn R Programming

far (version 0.6-7)

multplot: Multivariate plots

Description

Multivariate plots of Functional Data (more precisely fdata objects).

Usage

multplot(object, ...)

# S3 method for fdata multplot (object, date = 1, xval = NULL, name = NULL, legend = FALSE, yleg, xlab = NULL, ylab = NULL, main = NULL, whole = FALSE, ...)

Arguments

object

An fdata object for which a multplot is desired.

date

String vector. List of the dates to work with.

xval

Numerical vector. Values of the axis x.

name

String vector. The set of variables to plot.

legend

Boolean. Plot a legend ?

yleg

Numeric. Where to put the legend box (y value).

xlab

String. Title of the axis x.

ylab

String. Title of the axis y.

main

String. Title of the plot.

whole

Boolean. A global plot (TRUE) or a plot by day (FALSE)

...

Additional arguments.

Author

J. Damon

Details

This function facilitate the plotting of fdata objects. It is dedicated to multivariate plots, please take a look at plot.fdata if you need univariate plots in one graphic.

The default behaviour is to produce one plot containing all the variables of the observation called "1".

If you want less variables, use the name argument. If you need more observations, use the date argument. When provided, the xval argument allow you to change the labels of the x-axis.

It is also possible to plot the complete series on the same plot using the whole argument.

Moreover a legend facility is provided using the legend and yleg arguments.

See Also

fdata, plot.fdata.

Examples

Run this code
  # Simulation of a FARX process
  data1 <- simul.farx(m=10,n=100,base=base.simul.far(20,5),
                base.exo=base.simul.far(20,5),
                d.a=matrix(c(0.5,0),nrow=1,ncol=2),
                alpha.conj=matrix(c(0.2,0),nrow=1,ncol=2),
                d.rho=diag(c(0.45,0.90,0.34,0.45)),
                alpha=diag(c(0.5,0.23,0.018)),
                d.rho.exo=diag(c(0.45,0.90,0.34,0.45)),
                cst1=0.0)

 # 2 variables : X et Z
 # number of points per curve : 10
 # number of curves : 100
 # corresponding dates
 date.fdata(data1)

 multplot(data1) # plot the date "1" of the variables "X" and "Z"
 multplot(data1,legend=TRUE) # Same thing with a legend
 multplot(data1,legend=TRUE,yleg=-0.5) # same thing with a legend misplaced
 multplot(data1,main="day 1",legend=TRUE,xlab="hour",
          ylab="object of study")

 par(mfrow=c(1,3))
 multplot(data1,date=c("3","4","5")) # days "3", "4" and "5" are plotted
 par(mfrow=c(1,1))

 # to plot the whole series, we used whole = TRUE
 # but we have to give the x values

 multplot(data1,xval=seq(from=0,to=99.9,by=0.1),whole=TRUE)

 # to plot a subset of the series,
 # it is recommended to create a subset object with select.fdata
 data2 <- select.fdata(data1,date=c("4","5","6"))
 multplot(data2,xval=seq(from=4,to=6.9,by=0.1),whole=TRUE)

Run the code above in your browser using DataLab