| autoplot.unsurv | R Documentation |
ggplot2 autoplot for unsurv objects
## S3 method for class 'unsurv'
autoplot(object, ...)
object |
An object of class |
... |
Unused. |
A ggplot object.
if (requireNamespace("cluster", quietly = TRUE)) {
set.seed(1)
times <- seq(0, 4, length.out = 25)
grp <- rep(1:2, each = 10)
rates <- c(0.2, 0.55)
S <- sapply(times, function(t) exp(-rates[grp] * t))
fit <- unsurv(S, times, K = 2)
ggplot2::autoplot(fit)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.