Learn R Programming

longitudinalData (version 0.6.4)

longData: ~ Function: longData ~

Description

longData is the constructor of the class LongData.

Usage

longData(traj, id, time, varName,other)

Arguments

traj
[matrix(numeric)]: structure containning the trajectories.
id
[vector(character)]: single identifier for each trajectory (ie each individual).
time
[vector(numeric)]: time at which measures were made.
varName
[character]: name of the variable being measured.
other
[list]: list of additionnal information.

Value

  • An object of class LongData.

Details

longData construct a object of class LongData. It does not provide any default values.

See Also

as.longData, LongData, plot

Examples

Run this code
### Small data
mat <- matrix(c(1,NA,3,2,3,6,1,8,10),3,3,dimnames=list(c(101,102,104),c("T2","T4","T8")))
(ld1 <- longData(traj=mat,id=as.character(c(101,102,104)),time=c(2,4,8),varName="T",other=list()))
plot(ld1,col=1,type.mean="n")

### Big data
mat <- matrix(runif(1051*325),1051,325)
(ld2 <- longData(traj=mat,id=paste("I-",1:1051,sep=""),time=(1:325)+0.5,varName="Random"))

Run the code above in your browser using DataLab