View source: R/plot_matdistribution.R
plot.Matdist | R Documentation |
Helper function to more easily plot a Matdist.
## S3 method for class 'Matdist' plot(x, fun = c("pdf", "cdf", "survival", "hazard", "cumhazard"), ...)
x |
Matdist. |
fun |
function to plot, one of: "pdf","cdf", "survival", "hazard", "cumhazard". |
... |
Other parameters passed to matplot. |
Essentially just a wrapper around matplot.
plot.Distribution plot.VectorDistribution
## Not run: pdf <- runif(200) mat <- matrix(pdf, 20, 10) mat <- t(apply(mat, 1, function(x) x / sum(x))) colnames(mat) <- 1:10 d <- as.Distribution(mat, fun = "pdf") plot(d, "pdf", xlab = "x", ylab = "p(x)") plot(d, "cdf", xlab = "x", ylab = "F(x)") plot(d, "survival", xlab = "x", ylab = "S(x)") plot(d, "hazard", xlab = "x", ylab = "h(x)") plot(d, "cumhazard", xlab = "x", ylab = "H(x)") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.