Learn R Programming

kmlShape (version 0.9.5)

cldsWide: ~ Function: cldsWide ~

Description

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

Usage

cldsWide(trajWide, times, id)

Arguments

trajWide
[data.frame] or [matrix]: the trajectories, in wide format (each line is an individual, each column is a specific time measurement).
times
[vector(numeric)] Times at which measures are made.
id
[vector(factor)] Vector of unique identifiers, one for each trajectories. If id is missing, the first column of the trajWide is turn into a factor and is used as id.

Value

Object of class Clds-class.

Details

Turn trajectories in wide format into an object of class Clds. If id is missing, the first column of the trajWide is turn into a factor and is used as id. Column 2:ncol(trajWide) are the trajectories. If id is not missing, column 1:ncol(trajWide) are the trajectories.

Examples

Run this code
data(ictusShort)
myClds <- cldsWide(ictusShort)
myClds
plotTraj(myClds)

Run the code above in your browser using DataLab