calcop: Calculate interpolation for optimal values

View source: R/calcop.R

calcopR Documentation

Calculate interpolation for optimal values

Description

The function interpolates simulations in DBSolveOptimum for the series of conditions and create mod.frame object.

Usage

calcop(input, x.col, x.seq, y.col, factor.col = c())

Arguments

input

data.frame passed from DBSolveOptimum output

x.col

number or name of column in input corresponded to free variable (i.e. time).

x.seq

numerical vector of points to interpolate values in x.col.

y.col

vector of column numbers or names in input corresponded to simulated variables (model output).

factor.col

vector of column numbers or names in input corresponded to condition parameters (model input).

Value

The returned value is mod.frame class object which is extension of data.frame class with the additional attributed. The columns describe:

names(x.col)

free variable values passed from argument x.col.

var_id

names of simulated variables as passed from y.col.

simulation

column represents simulation value for interpolated points.

names(factor.col)

condition variable values passed from argument factor.col.

group

unique identifier for combination of factor.col.

The value has the additional attributes:

col.def

definition of columns, type of data in columns.

col.title

titles for columns. May be usefull for visualization.

var.title

titles for simulated variables. May be usefull for visualization.

group.title

titles for condition groups. May be usefull for visualization.

See Also

calccb
approxfun

Examples

### calculation based on example4.slv
## Not run: example4_output_op<-read.delim("dbs_output_op.txt") # read from output
example4_op<-calcop(input=example4_output_op,
                    x.col="t",
                    x.seq=seq(0,96,by=0.5),
                    y.col=c("C0","C1"),
                    factor.col = c("Dose","T"))
## Not run: write.delim(example4_op, "example4_op.txt") # save results

### plot all results with lattice
library(lattice)
xyplot(simulation~t|var_id+group,
       data=example4_op,
       type="l",
       lty=1,
       xlab="Time, h",
       ylab="Concentration of drug, ng/ml",
       main="All CB simulations")

insysbio/dbs-package documentation built on Aug. 4, 2022, 2:11 p.m.