petab_mutateDCO: Consistently mutate the dco

View source: R/PEtab.R

petab_mutateDCOR Documentation

Consistently mutate the dco

Description

If j is supplied, the full dco is always returned and no subsetting is done!

Usage

petab_mutateDCO(pe, i, j)

Arguments

pe

petab()

i

expression to subset the dco, can be missing

j

Must be a call of the form :=(hsdhfgjs). If missing, pe is subsetted by i

Value

pe with modified DCO

Author(s)

Daniel Lill (daniel.lill@physik.uni-freiburg.de)

See Also

Other dco: dco_expandPatterns(), petab_joinDCO(), petab_unjoinDCO()

Examples

# 1. supply i and j, mutate in rows defined by i. Important: Need to assign!
pe <- petab_exampleRead("02")
pe <- petab_mutateDCO(pe, replicateId == 2 & observableId == "obsE", `:=`(observableId = "obsE_special", observableFormula = "log(E)/log(7)"))
pe
# 2. supply i only. Subset to rows
pe <- petab_exampleRead("02")
pe <- petab_mutateDCO(pe, replicateId == 2 & observableId == "obsE")
pe
# 3. supply j only. Mutate all rows
pe <- petab_exampleRead("02")
pe <- petab_mutateDCO(pe, j = `:=`(observableId = "obsE_special", observableFormula = "log(E)/log(7)", observableName = "obsE_special", noiseFormula = "1"))
pe

dlill/petab documentation built on Oct. 9, 2022, 3:07 p.m.