Learn R Programming

fda.usc (version 0.9.4)

plot.fdata: Plot functional data: fdata.

Description

Plot object of class fdata.

Usage

plot.fdata(x,type,main,xlab,ylab,...)
lines.fdata(x,...)
title.fdata(x,main=NULL,xlab=NULL,ylab=NULL,rownames=NULL)

Arguments

x
fdata class object with: i.- "data": matrix of set cases with dimension (n x m), where n is the number of curves and m are the discretization points observed in each curve, i
type
1-character string giving the type of plot desired. The following values are possible, for details, see plot: "l" for lines (by default),"p" for points, , "o" for overplotted points and lines, "b", "c" for (empty if "c") points joined by lines, "s" and "S
main
an overall title for the plot: see title.
xlab
xlab title for x axis, as in plot.
ylab
ylab title for y axis, as in plot.
rownames
row names.
...
Further arguments passed to matplot function.

Details

Plot fdata object.

See Also

See Also as fdata

Examples

Run this code
a1<-seq(0,1,by=.01)
a2=rnorm(length(a1),sd=0.2)
f1<-(sin(2*pi*a1))+rnorm(length(a1),sd=0.2)
nc<-10
np<-length(f1)
tt=seq(0,1,len=101)
mdata<-matrix(NA,ncol=np,nrow=nc)
for (i in 1:nc) mdata[i,]<- (sin(2*pi*a1))+rnorm(length(a1),sd=0.2)
fdataobj<-fdata(mdata,tt)
res=plot.fdata(fdataobj,type="l",col=gray(1:nrow(mdata)/nrow(mdata)))
lines(func.mean(fdataobj),col=3,lwd=2) #original curve

Run the code above in your browser using DataLab