Learn R Programming

drc (version 0.8-2)

plot.drc: Plotting fitted curves for a drc object

Description

'plot' displays fitted curves and observations in the same plot window, distinguishing between curves by different plot symbols and line types.

Usage

plot.drc(x, ..., level=NULL, breakCurve = FALSE, colour=FALSE, 
  conLevel, conName, grid=100, legend=TRUE, legendText, 
  type = "average", obs, col, lty, log="x", xlab, ylab, xlim, ylim)

Arguments

x
an object of class 'drc'. For instance, 'lwd=2' or 'lwd=3' increase the width of plot symbols.
...
additional arguments.
level
vector of character strings. To plot only the curves specified by their names.
breakCurve
logical. If TRUE the curves break before reaching control. Experimental.
colour
either logical or a vector of colours. If TRUE default colours are used. If FALSE (default) no colours are used.
conLevel
numeric. Dose level below which the dose is zero (the amount of stretching on the x-axis above zero). Default is 1e-2.
conName
character string. Name on x axis for dose zero. Default is '"0"'.
grid
numeric. Number of points in the grid used for plotting the fitted curves.
legend
logical. If TRUE a legend is displayed.
legendText
a character string or vector of character strings specifying the legend text.
type
a character string specifying how the originals observations should be plotted. There are 4 options: "average" (default), "none", "points" and "add" (for adding a fit to an existing plot).
obs
Outdated argument. Use type.
col
a vector of colours. One colour for each curve.
lty
a numeric vector specifying the line types.
log
a character string which contains '"x"' if the x axis is to be logarithmic, '"y"' if the y axis is to be logarithmic and '"xy"' or '"yx"' if both axes are to be logarithmic. The default is "x". The empty string "" yields the original axes.
xlab
an optional label for the x axis.
ylab
an optional label for the y axis.
xlim
a numeric vector of length two, containing the lower and upper limit for the x axis.
ylim
a numeric vector of length two, containing the lower and upper limit for the y axis.

Value

  • An invisible data frame with the values used for plotting the fitted curves. The first column contains the dose values, and the following columns (one for each curve) contain the fitted response values.

Details

Suitable labels are automatically provided. The use of xlim allows changing the x-axis, extrapolating the fitted dose-response curves. See colors for the available colours.

See Also

plotraw plots the observations only.

Examples

Run this code
## Fitting models to be plotted below
model1 <- multdrc(MEANLR~MM, data=FA)
model2 <- multdrc(MEANLR~MM, data=FA, fct=l3())  # lower limit fixed at 0

## Plotting observations and fitted curve for 'model1'
plot(model1)

## Adding fitted curve for 'model2'
plot(model2, type="add")

## Fitting model to be plotted below
model3 <- multdrc(SLOPE~DOSE, CURVE, data=PestSci)

## Plot with no colours
plot(model3)

## Plot with default colours
plot(model3, colour=TRUE)

## Plot with specified colours
plot(model3, colour=c(2,6,15,23,56))

## Plot of curves 1 and 2 only
plot(model3, level=c(1,2))

## Fitting another model to be plotted below
model4 <- multdrc(weight~conc, data=hormesis)

## Using the argument 'conLevel'. Compare the plots!
plot(model4)  # using default setting 'conLevel=1e-2'
plot(model4, conLevel=1e-4)
plot(model4, conLevel=1e-8)

## Removing models from work space
rm(model1, model2, model3, model4)

Run the code above in your browser using DataLab