Description Usage Arguments Author(s) Examples
Plot functional data, color curves according to cluster labels and add center curves.
1 2 3 4 5 6 7 8 9 10 11 | ## S4 method for signature 'matrix'
plotFuncy(data, regTime=NULL, col=NULL,
ctr=NULL, ctrOnly=FALSE, ctrCols=NULL, showLegend=TRUE,
legendPlace="bottomleft", lty=3, lwd=NULL, xlim=NULL,
ylim=NULL, xlab=NULL, ylab=NULL, ...)
## S4 method for signature 'sampleFuncy'
plotFuncy(data, regTime=NULL, col=NULL,
ctr=NULL, ctrOnly=FALSE, ctrCols=NULL, showLegend=TRUE,
legendPlace="bottomleft", lty=3, lwd=NULL, xlim=NULL,
ylim=NULL, xlab=NULL, ylab=NULL, ...)
|
data |
For irregular time measurements, a matrix consisting of curveID in first
column, curve evaluations in second and time evaluation points in third
column (Format1).
For regular time measurements, a matrix consisting of curves in rows and time evaluations in
columns (Format2).
Alternatively an object created by |
regTime |
If Format2, optional vector representing the evaluation time points. If regTime=NULL equidistant time points from 1 to number of curves are used. |
col |
Numeric vector of cluster labels. |
ctr |
Numeric matrix of cluster centers |
ctrOnly |
Plot only centers, no curves? |
ctrCols |
Numeric vector specifying the color of the center curves. |
showLegend |
Whether to show cluster legend. |
legendPlace |
Where to place cluster legend. |
lty |
Line type of the functional data. |
lwd |
Line width of the functional data. |
xlim |
Range of x-axis. |
ylim |
Range of y-axis. |
xlab |
A title for the x axis. |
ylab |
A title for the y axis. |
... |
Further plotting parameters. |
Christina Yassouridis
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ##cluster the data with methods for regular sets
##sample a regular dataset
set.seed(2001)
ds <- sampleFuncy(obsNr=40, k=4, timeNr=20, reg=TRUE)
data <- Data(ds)
clusters <- Cluster(ds)
##plot sampled functions.
plotFuncy(data, col=clusters, lty=1, showLegend=TRUE, legendPlace="topleft")
##sample an irregular dataset
set.seed(2001)
ds <- sampleFuncy(obsNr=40, k=4, timeNrMin=2, timeNrMax=10, reg=FALSE)
data <- Data(ds)
clusters <- Cluster(ds)
##plot sampled functions.
plotFuncy(data, col=clusters, lty=1, showLegend=TRUE, legendPlace="topleft")
##cluster functions with method fitfclust
res <- funcit(data=data, clusters=clusters,
methods="fitfclust",
k=4)
##plot including the centers
plotFuncy(data, col=clusters, ctr=Center(res), showLegend=TRUE, legendPlace="topleft")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.