View source: R/plot_densities.R
plot_densities | R Documentation |
This function plots the kernel density function estimates for controls and cases from an object of class ‘groc’. It offers the possibility of plotting the histograms instead of the smooth estimates.
plot_densities(obj, h = c(1, 1), histogram = FALSE, breaks = 15,
col = c("#485C99", "#8F3D52"), lwd = 2, xlim = NULL, ylim = NULL,
xaxs = "i", yaxs = "i", xlab = "Marker", ylab = "f(x)",
main = "Density functions", legend = FALSE, pos.legend = "topright",
cex.lab = 1.5, cex.axis = 1.5, cex.main = 2, cex.legend = 1,
eps = sqrt(.Machine$double.eps), new = TRUE, ...)
obj |
An object of class ‘groc’. |
h |
A vector of length 2 with the bandwidth used to compute kernel density estimation for controls and cases, respectively. See |
histogram |
If TRUE, histograms are displayed instead of kernel density estimates. Default: FALSE. |
breaks |
If |
col |
A vector of length 2 with color used for controls and cases, respectively. Default: |
lwd |
Line width for the density function or histogram. Default: 2. |
xlim , ylim |
Range for x- and y-axis. |
xaxs , yaxs |
The style of axis interval calculation to be used for the x- and the y-axis, respectively. Default: |
xlab , ylab |
Label for x- and y-axis. |
main |
Title for the plot. |
cex.lab , cex.axis , cex.main |
The magnification to be used for labels, axis annotation and main titles, respectively, relative to the current setting of |
legend |
If TRUE, a legend with the meaning of colors is displayed on the left plot. Default: FALSE. |
pos.legend , cex.legend |
The position and magnification to be used for legend, relative to the current setting of |
eps |
Epsilon value to consider. Default: |
new |
If TRUE, a new plot is displayed; otherwise, density estimates are displayed over the current plot. Default: TRUE. |
... |
Other parameters to be passed. Not used. |
A plot of the kernel density function estimates for both populations with the selected graphical parameters
data(HCC)
roc_cg20202438 <- gROC(X = HCC$cg20202438, D = HCC$tumor)
plot_densities(roc_cg20202438, main = "Density functions and histogram")
plot_densities(roc_cg20202438, histogram = TRUE, new = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.