parLongData: ~ Function: parLongData, parTraj and parMean~

View source: R/parLongData.r

parLongDataR Documentation

~ Function: 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 (see details).

pch

[numeric] or [character]: Either an integer specifying a symbol or special values 'letters' or 'symbol' (see details).

pchPeriod

[numeric]: Fix the number of point that should be plot. Usefull to plot points on trajectories with a lot of mesurement (see examples in plotTrajMeans for LongData for details).

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.

Details

parLongData is the basic constructor of the class ParLongData.

parTRAJ create an object with default values for ploting individual trajectories ;

parMEAN create an object with default values for ploting mean trajectories.

If col='clusters', pch='letters' or pch='symbol', the object can not be use directly, it should first be prepared using the function expandParLongData.

Value

An object of class ParLongData

Author(s)

Christophe Genolini
PSIGIAM: Paris Sud Innovation Group in Adolescent Mental Health
INSERM U669 / Maison de Solenn / Paris

Contact author : <genolini@u-paris10.fr>

English translation

Rapha<eb>l Ricaud
Laboratoire "Sport & Culture" / "Sports & Culture" Laboratory
University of Paris 10 / Nanterre

Examples

##################
### 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 <- longData3d(
   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
plotTrajMeans3d(ld2)
plotTrajMeans3d(ld2,parTraj=parTRAJ())

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

longitudinalData documentation built on Feb. 16, 2023, 9:54 p.m.