Learn R Programming

latrend (version 1.1.0)

transformFitted: Helper function for ensuring the right fitted() output

Description

This function is also responsible for checking whether the input data is valid, such that the fitting process can fail early.

Usage

transformFitted(pred, model, clusters)

# S4 method for `NULL`,lcModel transformFitted(pred, model, clusters)

# S4 method for matrix,lcModel transformFitted(pred, model, clusters)

# S4 method for list,lcModel transformFitted(pred, model, clusters)

# S4 method for data.frame,lcModel transformFitted(pred, model, clusters)

Arguments

pred

Prediction object

model

The model from which the prediction is made.

clusters

Optional argument for specifying the trajectory cluster assignments.

Value

A vector if the clusters argument is specified, else a matrix with the fitted values per cluster per column.