plotResponseSurface {BIGL} | R Documentation |
Plot response surface
Description
Plot the 3-dimensional response surface predicted by one of the null
models. This plot allows for a visual comparison between the null
model prediction and observed points. This function is mainly used
as the workhorse of plot.ResponseSurface
method.
Usage
plotResponseSurface(
data,
fitResult = NULL,
transforms = fitResult$transforms,
predSurface = NULL,
null_model = c("loewe", "hsa", "bliss", "loewe2"),
colorPalette = c("red", "grey70", "blue"),
colorPaletteNA = "grey70",
colorBy = "none",
addPoints = TRUE,
colorPoints = c("black", "sandybrown", "brown", "white"),
breaks,
radius = 4,
logScale = TRUE,
colorfun = median,
zTransform = function(x) x,
add = FALSE,
main = "",
legend = FALSE,
xat = "actual",
yat = "actual",
plotfun = NULL,
gradient = TRUE,
width = 800,
height = 800,
title = "",
digitsFunc = function(x) {
x
},
reverse = FALSE,
...
)
Arguments
data |
Object "data" from the output of |
fitResult |
Object "fitResult" from the output of |
transforms |
Object "transforms" from the output of |
predSurface |
Vector of all predicted responses based on
|
null_model |
If |
colorPalette |
Vector of color names for surface |
colorPaletteNA |
Color used in the matrix of colours when the combination of doses doesn't exist (NA) |
colorBy |
This parameter determines values on which coloring is based
for the 3-dimensional surface. If matrix or a data frame with |
addPoints |
Boolean whether the dose points should be included |
colorPoints |
Colors for off-axis and on-axis points. Character vector of length four with colors for 1) off-axis points; 2) on-axis points of the first drug (i.e. second drug is dosed at zero); 3) on-axis points of the second drug; 4) on-axis points where both drugs are dosed at zero. |
breaks |
Numeric vector with numerical breaks. To be used in conjunction
with |
radius |
Size of spheres (default is 4) |
logScale |
Draw doses on log-scale (setting zeroes to be finite constant) |
colorfun |
If replicates in |
zTransform |
Optional transformation function for z-axis. By default, identity function is used. |
add |
(deprecated) Add the predicted response surface to an existing plot. Will not
draw any points, just the surface. Must be called after another call to
|
main |
Fixed non-moving title for the 3D plot |
legend |
Whether legend should be added (default FALSE) |
xat |
x-axis ticks: "pretty", "actual" or a numeric vector |
yat |
y-axis ticks: "pretty", "actual" or a numeric vector |
plotfun |
If replicates for dose combinations in |
gradient |
Boolean indicating whether colours should be interpolated between breaks (default TRUE).
If FALSE, |
width |
Width in pixels (optional, defaults to 800px). |
height |
Height in pixels (optional, defaults to 800px). |
title |
String title (default "") |
digitsFunc |
Function to be applied to the axis values |
reverse |
Boolean indicating whether colours should be reversed (default FALSE). |
... |
Further arguments to format axis labels |
Value
Plotly plot
Examples
## Not run:
data <- subset(directAntivirals, experiment == 1)
## Data must contain d1, d2 and effect columns
fitResult <- fitMarginals(data)
data_mean <- aggregate(effect ~ d1 + d2, data = data[, c("d1", "d2", "effect")],
FUN = mean)
## Construct the surface from marginal fit estimates based on HSA
## model and color it by mean effect level
plotResponseSurface(data, fitResult, null_model = "hsa",
colorBy = data_mean, breaks = 10^(c(0, 3, 4, 6)),
colorPalette = c("grey", "blue", "green"))
## Response surface based on Loewe additivity model and colored with
## rainbow colors.
plotResponseSurface(data, fitResult, null_model = "loewe", breaks = c(-Inf, 0, Inf),
colorBy = "colors", colorPalette = rainbow(6))
## End(Not run)