plus-.datalist: Direct sum of datasets

Description Usage Arguments Details Value Examples

Description

Used to merge datasets with overlapping conditions.

Usage

1
2
## S3 method for class 'datalist'
data1 + data2

Arguments

data1

dataset of class datalist

data2

dataset of class datalist

Details

Each data list contains data frames for a number of conditions. The direct sum of datalist is meant as merging the two data lists and returning the overarching datalist.

Value

Object of class datalist for the union of conditions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
  # Start with two data frames
  mydata1 <- data.frame(
    name = "A",
    time = 0:1,
    value = 1:2,
    sigma = .1,
    compound = c("DEM", "APAP"),
    dose = "0.1"
  )
  
  mydata2 <- data.frame(
    name = "A",
    time = 0:1,
    value = 3:4,
    sigma = .1,
    compound = c("APAP", "DCF"),
    dose = "0.1"
  )
 
  # Create datalists from dataframes
  data1 <- as.datalist(mydata1, split.by = c("compound", "dose")) 
  data2 <- as.datalist(mydata2, split.by = c("compound", "dose")) 
  
  # Direct sum of datalists
   data <- data1 + data2
   print(data)
  
  # Check the condition.grid (if available)
   condition.grid <- attr(data, "condition.grid")
   print(condition.grid)

dMod documentation built on Jan. 27, 2021, 1:07 a.m.