View source: R/plot_vectordistribution.R
plot.VectorDistribution | R Documentation |
Helper function to more easily plot distributions inside a VectorDistribution.
## S3 method for class 'VectorDistribution' plot(x, fun = "pdf", topn, ind, cols, ...)
x |
VectorDistribution. |
fun |
function to plot, one of: "pdf","cdf","quantile", "survival", "hazard", "cumhazard". |
topn |
|
ind |
|
cols |
|
... |
Other parameters passed to plot.Distribution. |
If topn
and ind
are both missing then all distributions are plotted if there are 10 or less
in the vector, otherwise the function will error.
plot.Distribution
## Not run: # Plot pdf of Normal distribution vd <- VectorDistribution$new(list(Normal$new(), Normal$new(mean = 2))) plot(vd) plot(vd, fun = "surv") plot(vd, fun = "quantile", ylim = c(-4, 4), col = c("blue", "purple")) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.