Learn R Programming

drugCombo (version 1.2.1)

plot.HarbronFit: Plot method for HarbronFit objects

Description

Diagnostic and goodness-of-fit plots (in 2D and 3D).

Usage

# S3 method for HarbronFit
plot(x, y = NULL, which = c("nls", "2d", "3d"), ...)

Arguments

x

A HarbronFit object returned by fitModel.

y

A (optional) second HarbronFit object returned by fitModel. If provided, which argument is ignored and a 2d-plot comparing two model fits is produced. Note that the two models should have been fitted on the same data. Note that this argument can also be used as which. See examples.

which

Whether to show default plot.nls ("nls"), a 'slice' plot with fitted curves overlaid on top of the observed data ("2d") or a 3d-plot with fitted surface overlaid on top of the observed data ("3d").

...

Further arguments passed to plot.nls, fitPlot2d or fitPlot3d depending on which.

Value

Output from plot.nls, a ggplot2 object if which = "2d", or a 3d rgl plot if which = "3d".

Examples

Run this code
# NOT RUN {
data("checkerboardData", package = "drugCombo")
data1 <- checkerboardData[checkerboardData$exp == 1, ]
fitUniform <- fitModel(data1, model = "uniform")
fitLinear <- fitModel(data1, model = "linear1")
plot(fitUniform, fitLinear)
plot(fitLinear, "2d")  # here 2nd argument is interpreted as `which`
# }

Run the code above in your browser using DataLab