Learn R Programming

fdapace (version 0.1.1)

CreatePathPlot: Create the sample path plot based on the results from FPCA().

Description

Create the sample path plot based on the results from FPCA().

Usage

CreatePathPlot(fpcaObj, subset, k = NULL,
  inputData = fpcaObj[["inputData"]], showObs = !is.null(inputData),
  derOptns = NULL, ...)

Arguments

fpcaObj
Returned object from FPCA().
subset
A vector of indices or a logical vector for subsetting the observations.
k
The number of components to reconstruct the sample paths.
inputData
A list of length 2 containing the sparse/dense (unsupported yet) observations. inputData needs to contain two fields: t for a list of time points and y for a list of observations. Default to the `inputData` field wit
showObs
Whether to plot the original observations for each subject.
derOptns
A list of options to control derivation parameters; see `fitted.FPCA'. (default = NULL)
...
other arguments passed into matplot for plotting options

Examples

Run this code
set.seed(1)
n <- 20
pts <- seq(0, 1, by=0.05)
sampWiener <- Wiener(n, pts)
sampWiener <- Sparsify(sampWiener, pts, 10)
res <- FPCA(sampWiener$yList, sampWiener$tList, 
            list(dataType='Sparse', error=FALSE, kernel='epan',
            verbose=TRUE))
CreatePathPlot(res, subset=1:5)

Run the code above in your browser using DataLab