wide2long.list: Translate wide output format (e.g. from ode) into long format

View source: R/tools.R

wide2long.listR Documentation

Translate wide output format (e.g. from ode) into long format

Description

Translate wide output format (e.g. from ode) into long format

Usage

## S3 method for class 'list'
wide2long(out, keep = 1, na.rm = FALSE)

Arguments

out

list of matrices in wide format

keep

Index vector, the columns to keep

na.rm

Logical, if TRUE, missing values are removed in the long format.

Details

The function assumes that out[,1] represents a time-like vector whereas out[,-1] represents the values. Useful for plotting with ggplot. If a list is supplied, the names of the list are added as extra column names "condition"

Value

data.frame in long format, i.e. columns "time" (out[,1]), "name" (colnames(out[,-1])), "value" (out[,-1]) and, if out was a list, "condition" (names(out))


dkaschek/dMod documentation built on April 23, 2024, 5:18 p.m.