Learn R Programming

far (version 0.6-7)

plot.fdata: Plot Functional Data

Description

Plot Functional Data (more precisely fdata objects).

Usage

# S3 method for fdata
plot(x,...,date, xval, name, main, whole, separator)

Arguments

x

A fdata object.

date

A vector of character giving the chosen dates.

xval

A numerical vector giving the values to appear on the x axis.

name

A vector of character giving the plotted variables.

main

an overall title for the plot.

whole

Logical. If TRUE all the observations are plot on the same graphic.

separator

Logical. It will be used when whole=TRUE. If TRUE then dashed lines are plotted to separated the observations.

...

Additional arguments to the plot.

Author

J. Damon

Details

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

The default behaviour is to plot the observation called "1" of all the variables available in x (so it will produce as many plots as the number of variables).

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. In this case, the separator allow you to draw line to distinguish the different observations of the functional data.

See Also

fdata, multplot.

Examples

Run this code
  # Reading of the data
  library(stats)
  data(UKDriverDeaths)

  # Making the data of class 'fdata'
  fUKDriverDeaths <- as.fdata(UKDriverDeaths, col=1, p=12,
                            dates=1969:1984,
                            name="UK Driver Deaths")
  summary(fUKDriverDeaths)

  # plotting of the data : whole and 1 year
  par(mfrow=c(2,1))
  plot(fUKDriverDeaths, xval=1969+(1:192)/12,
       whole=TRUE, name="Whole Evolution : ", separator=TRUE)
  plot(fUKDriverDeaths, date="1984", xval=1:12,
       name="Evolution during year 1984 : ")

Run the code above in your browser using DataLab