Last chance! 50% off unlimited learning
Sale ends in
longData3d
is a constructor of the class LongData
.
It create object LongData
containing several joint trajectory (two
or more variable-trajectories). For creating a single
variable-trajectory, see longData
.longData3d(traj, idAll, time, timeInData,varNames,maxNA)
[array(numeric)]
or data.frame
: structure containning the variable-trajectories.[vector(character)]
: single identifier for each trajectory (ie each individual).[vector(numeric)]
: time at which measures were made.[list(vector(numeric))]
: Precise the column containing the
trajectories. If traj
is a data.frame
, it sould be a list.[character]
: name of the variable-trajectories being measured.[vector(numeric)]
: maximum number of NA that are tolerates
on a trajectory (one for each variable). If a trajectory has more
missing than maxNA, then it is remove from the analysis.LongData
.longData3d
construct a object of class
LongData
. Two cases can be distinguised:
[object Object],[object Object]#################
### From array
### Small data
mat <- array(c(1,NA,3,2,3,6,1,8,10,1,NA,1,2,NA,3,2,3,2),dim=c(3,3,2))
longData3d(mat)
(ld1 <- longData3d(mat,varNames=c("Hyp","Col"),idAll=c("i101","i104","i105")))
plotTraj3d(ld1)
### Big data
mat <- array(c(runif(1051*325),rnorm(1051*325),rexp(1051*325)),c(1051,325,3))
(ld2 <- longData3d(traj=mat,time=(1:325)+0.5,varNames=c("unif","norm","rexp")))
plotTraj3d(ld2,nbSample=200)
#################
### From data.frame
dn <- data.frame(id=1:3,v1=c(2,2,1),t1=c(20,21,22),v1=c(3,2,2),t2=c(23,20,28),t3=c(25,24,29))
longData3d(dn,timeInData=list(c(2,4),c(3,5)),varNames=c("V","T"))
(ld3 <- longData3d(dn,timeInData=list(V=c(2,4,NA),T=c(3,5,6))))
plotTraj3d(ld3)
Run the code above in your browser using DataLab