tcplAddModel | R Documentation |
tcplAddModel
draws a a line for one of the tcpl Models (see
Models
for more information) onto an existing plot.
tcplAddModel(pars, modl = NULL, adj = NULL, ...)
pars |
List of parameters from level 4 or 5 output |
modl |
Character of length 1, the model to plot: 'cnst,' 'hill,' or 'gnls' |
adj |
Numeric of length 1, an adjustment factor, see details for more information |
... |
Additional arguments passed to |
tcplAddModel
draws the model line assuming the x-axis represents log
base 10 concentration.
If modl
is NULL, the function checks pars$modl
and will return
an error if pars$modl
is also NULL.
adj
is intended to scale the models, so that models with different
response units can be visualized on a single plot. The recommended value for
adl
is 1/(3*bmad)
for level 4 data and 1/coff
for level
5 data. If adj
is NULL the function will check pars$adj
and
set adj
to 1 if pars$adj
is also NULL.
Models
, tcplPlotFits
## Create some dummy data to plot
logc <- 1:10
r1 <- sapply(logc, tcplHillVal, ga = 5, tp = 50, gw = 0.5)
r2 <- log2(sapply(logc, tcplHillVal, ga = 4, tp = 30, gw = 0.5))
p1 <- tcplFit(logc = logc, resp = r1, bmad = 10)
p2 <- tcplFit(logc = logc, resp = r2, bmad = log2(1.5))
## In the dummy data above, the two plots are on very different scales
plot(r1 ~ logc, pch = 16, ylab = "raw response")
tcplAddModel(pars = p1, modl = "hill")
points(r2 ~ logc)
tcplAddModel(pars = p2, modl = "hill", lty = "dashed")
## To visualize the two curves on the same plot for comparison, we can
## scale the values to the bmad, such that a scaled response of 1 will equal
## the bmad for each curve.
plot(r1/10 ~ logc, pch = 16, ylab = "scaled response")
tcplAddModel(pars = p1, modl = "hill", adj = 1/10)
points(r2/log2(5) ~ logc)
tcplAddModel(pars = p2, modl = "hill", adj = 1/log2(5), lty = "dashed")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.