Learn R Programming

dMod (version 0.3.1)

datalist: Generate a datalist object

Description

The datalist object stores time-course data in a list of data.frames. The names of the list serve as identifiers, e.g. of an experimental condition, etc.

Usage

datalist(...)
as.datalist(x, ...)
"as.datalist"(x, split.by = NULL, ...)
"as.datalist"(x, names = NULL, ...)

Arguments

...
data.frame objects to be coerced into a list and additional arguments
x
object of class data.frame or list
split.by
vector of columns names which yield a unique identifier (conditions). If NULL, all columns except for the expected standard columns "name", "time", "value" and "sigma" will be selected.
names
optional names vector, otherwise names are taken from mylist

Value

Object of class datalist.Object of class datalist

Details

Datalists can be plotted, see plotData and merged, see sumdatalist. They are the basic structure when combining model prediction and data via the normL2 objective function.

Examples

Run this code
## Generate datalist from scratch
mydata1 <- data.frame(name = "A",
                      time = 0:5,
                      value = 0:5,
                      sigma = .1)

mydata2 <- data.frame(name = "A",
                      time = 0:5,
                      value = sin(0:5),
                      sigma = .1)

data <- datalist(C1 = mydata1, C2 = mydata2)
print(data)
plot(data)

## Generate datalist from singla data.frame
times <- seq(0, 2*pi, length.out = 20)
mydata <- data.frame(name = "A", 
                     time = times, 
                     value = c(sin(times), 1.5 * sin(times)), 
                     sigma = .1, 
                     stage = rep(c("upper", "lower"), each = 10),
                     phase = rep(c("first", "second"), each = 20))

data <- as.datalist(mydata, split.by = c("stage", "phase"))
print(data)
plot(data)

condition.grid <- attr(data, "condition.grid")
print(condition.grid)

Run the code above in your browser using DataLab