plot.dr4pl {dr4pl} | R Documentation |
Make a plot of a 4PL model curve and data
Description
This function displays a dose-response curve and data. As a default, the x-axis represents dose levels in log 10 scale and the y-axis represents responses. The black solid line represents a dose-response curve. The blue filled circles represent data points and red triangles represent outliers.
Usage
## S3 method for class 'dr4pl'
plot(
x,
type.curve = "all",
text.title = "Dose-response plot",
text.x = "Dose",
text.y = "Response",
indices.outlier = NULL,
breaks.x = NULL,
breaks.y = NULL,
...
)
Arguments
x |
‘dr4pl’ object whose data and mean response function will be plotted. |
type.curve |
Indicator of the type of a dose-response curve. "all" indicates that data and a curve will be plotted while "data" indicates that only data will be plotted. |
text.title |
Character string for the title of a plot with a default set to "Dose response plot". |
text.x |
Character string for the x-axis of the plot with a default set to "Dose". |
text.y |
Character string for the y-axis of the plot with a default set to "Response". |
indices.outlier |
Pass a vector indicating all indices which are outliers in the data. |
breaks.x |
Vector of desired break points for the x-axis |
breaks.y |
Vector of desired break points for the y-axis |
... |
All arguments that can normally be passed to ggplot. |
Author(s)
Hyowon An, ahwbest@gmail.com
Justin T. Landis, jtlandis314@gmail.com
Aubrey G. Bailey, aubreybailey@gmail.com
Examples
## Not run:
dr4pl.1 <- dr4pl(Response ~ Dose, data = sample_data_1)
plot(dr4pl.1)
## Able to further edit plots.
library(ggplot2) #needed to change color to green
dr4pl.1 <- dr4pl(Response ~ Dose,
data = sample_data_1,
text.title = "Sample Data Plot")
a <- plot(dr4pl.1)
a + geom_point(color = "green", size = 5)
## Bring attention to outliers using parameter indices.outlier.
dr4pl.3 <- dr4pl(Response ~ Dose,
data = drc_error_3,
method.init = "Mead",
method.robust = "absolute")
plot(dr4pl.3, indices.outlier = c(90, 101))
## Change the plot title default with parameter text.title.
dr4pl.1 <- dr4pl::dr4pl(Response ~ Dose,
data = sample_data_1)
plot(dr4pl.1, text.title = "My New Dose Response plot")
##Change the labels of the x and y axis to your need
library(drc) # Needed to load 'decontaminants' data set
data.hpc <- subset(decontaminants, group %in% "hpc")
dr4pl.hpc <- dr4pl(count~conc, data = data.hpc)
plot(dr4pl.hpc,
text.title = "hpc Decontaminants Plot",
text.x = "Concentration",
text.y = "Count")
## End(Not run)