Learn R Programming

kml3d (version 0.6)

parLongData: ~ Functions: parLongData, parTraj and parMean~

Description

parLongData, parTraj and parMean are constructors for the class ParLongData.

Usage

parLongData(type, col, pch, pchPeriod, cex, xlab, ylab)
parTraj(type = "l", col = "black", pch = "1", pchPeriod = 0, cex = 1, xlab = "Time", ylab = "")
parMean(type = "b", col = "clusters", pch = "letters", pchPeriod = 1, cex = 1.2, xlab = "Time", ylab = "")

Arguments

type
[character]: Set type of the plot should be drawn ('p' for point, 'l' for line, 'b' for both, 'c' line appart, 'o' for overplot, 'h' for histogram, 's' and 'S' for steps, 'n' for no ploting)
col
[character]: Set the plotting color. Vector of values are accepted. The special value 'clusters' can be use to color each trajectories according to its clusters.
pch
[numeric] or [character]: Either an integer specifying a symbol or a single character to be used as the default in plotting points.
pchPeriod
[numeric]: (for mean trajectories only) Fix the number of point that should be plot. Usefull to plot points on trajectories with a lot of mesurement (see examples in plot<
cex
[numeric]: Set the amount by which plotting text and symbols should be magnified relative to the default.
xlab
[character]: Title for the x axis.
ylab
[character]: Title for the y axis.

Value

  • An object of class ParLongData

Author(s)

Christophe Genolini INSERM U669 / PSIGIAM: Paris Sud Innovation Group in Adolescent Mental Health Modal'X / Universite Paris Ouest-Nanterre- La Defense Contact author : genolini@u-paris10.fr

Details

parLongData is the basic constructor of the class ParLongData. parTraj create an object whose default value are the one used when ploting some longitudinal data ; parMean create an object whose default value are the one used when ploting some mean trajectories.

References

Article "KmL: K-means for Longitudinal Data", in Computational Statistics, Volume 25, Issue 2 (2010), Page 317. Web site: http://christophe.genolini.free.fr/kml

Examples

Run this code
##################
### Construction of LongData

time=c(1,2,3,4,8,12,16,20)
id2=1:120
f <- function(id,t)((id-1)%%3-1) * t
g <- function(id,t)(id%%2+1)*t
ld2 <- as.longData(array(cbind(outer(id2,time,f),outer(id2,time,g))+rnorm(120*8*2,0,3),dim=c(120,8,2)))

### Example with default value
plot(ld2)
plot(ld2,paramTraj=parTraj())

### Example with default values for mean trajectories
plot(ld2,paramTraj=parMean())

### Example with default value except for the color
plot(ld2,paramTraj=parTraj(col="blue"))

Run the code above in your browser using DataLab