Learn R Programming

kmlShape (version 0.9.5)

cldsLong: ~ Function: cldsLong ~

Description

Turn trajectories in long format into an object of class Clds.

Usage

cldsLong(trajLong)

Arguments

trajLong
[data.frame]: the trajectories, in long format. The trajectories have to have (no choice) th following format: the first column is the identifier; the second is the time measurement ; the third is the values.

Value

Object of class Clds.

Details

Turn trajectories in long format into an object of class Clds-class.

Examples

Run this code

### Some artificial data
g <- function(x)dnorm(0:100,runif(1,25,75),10)*rnorm(1,5,1)
dn <- data.frame(id=rep(1:200,each=101),
   times=rep((0:100)/10,times=20),
   traj=as.numeric(sapply(1:200,g))
)

### clds format
myClds <- cldsLong(dn)
plotTraj(myClds)

Run the code above in your browser using DataLab