plotFit | R Documentation |
Prepare an informative plot of viral titer from the GLM fit.
plotFit(
fm,
main = NULL,
pch = 1,
col = 1,
col.pch = col,
lty.fit = 1,
col.fit = col,
lty.ref = 2,
col.ref = "gray",
xlim = NULL,
ylim = NULL,
ann = par("ann"),
xlab = NULL,
ylab = NULL,
axes = TRUE,
frame.plot = axes,
digits = 3,
...
)
fm |
fitted model or list of fitted models from |
main |
plot title as a character, vector of characters or list of
characters to be used as the plot title(s). Values will be replicated as
necessary. If |
pch , col , col.pch |
plot character and color for data points. The default
color for the points and the fitted line is |
lty.fit , col.fit |
line type and color for the GLM best-fit line. Set
|
lty.ref , col.ref |
line type and color for the value on the x-axis
that intersect the 63
|
xlim , ylim |
optional parameters to override the default parameters of
the full range of x values for |
ann |
a logical value indicating whether the default annotation (title and x and y axis labels) should appear on the plot. |
xlab |
a label for the x axis. If the |
ylab |
a label for the y axis, defaults to "Infected fraction". |
axes |
a logical value indicating whether both axes should be drawn on the plot. |
frame.plot |
a logical value indicating whether a box should be drawn around the plot. |
digits |
integer indicating the number of significant decimal palces to use for the calculated x-axis label |
... |
arguments to be passed to |
Base graphics are used to prepare a plot with log = "x"
from a single
fitted model or a list of fitted models generated by getFit
.
The function calls getEC63
to derive the titer and include
this information on the plot by default. The graphic parameters can be
used to change or exclude many elements of the plot. See the help
information in plot.default
for details.
If fm
is a list of fitted models, each will be plotted. Use
par(ask = TRUE)
to see each in turn or use
par(mfrow = c(nr, nc))
to place nr x nc
plots on one device.
Additional curves can be added with the addOneFit
as shown in
the examples.
No value is returned. This function is called for the side-effect of producing a plot (or plots).
# sample result from tally() with two sets of data
plotFit_data <- read.csv(system.file("extdata", "plotFit_data.csv",
package = "virustiter"))
fm <- getFit(plotFit_data, by = "row")
# Default format and example with minimal annotation
plotFit(fm$A)
plotFit(fm$A, ann = FALSE, axes = FALSE, lty.ref = NA)
# Example of two plots
plotFit(fm$A, "Two fits", xlab = "Multiplicity (ml/cell)")
addOneFit(fm$B)
legend("topleft", legend = c("A", "B"), lty = 1, col = c(1, 2), bty = "n")
# With two panel figure
par(mfrow = c(2, 1))
plotFit(fm, main = names(fm))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.