trajectories: Extract the trajectories

trajectoriesR Documentation

Extract the trajectories

Description

Transform or extract the trajectories from the given object to a standardized format.

The standardized data format is for method estimation by latrend, and for plotting functions.

Usage

trajectories(
  object,
  id = idVariable(object),
  time = timeVariable(object),
  response = responseVariable(object),
  ...
)

## S4 method for signature 'data.frame'
trajectories(
  object,
  id = idVariable(object),
  time = timeVariable(object),
  response = responseVariable(object),
  ...
)

## S4 method for signature 'matrix'
trajectories(
  object,
  id = idVariable(object),
  time = timeVariable(object),
  response = responseVariable(object),
  ...
)

## S4 method for signature 'call'
trajectories(object, ..., envir)

## S4 method for signature 'lcModel'
trajectories(
  object,
  id = idVariable(object),
  time = timeVariable(object),
  response = responseVariable(object),
  ...
)

Arguments

object

The data or model or extract the trajectories from.

id

The identifier variable name.

time

The time variable name.

response

The response variable name.

...

Additional arguments.

envir

The environment used to evaluate the data object in (e.g., in case object is of type call).

Details

The generic function removes unused factor levels in the Id column, and any trajectories which are only comprised of NAs in the response.

Value

A data.frame with columns matching the id, time, and response name arguments.

See Also

plotTrajectories latrend


latrend documentation built on March 31, 2023, 5:45 p.m.