Description Usage Arguments Details Value Author(s) Examples
View source: R/autoplot.clustcurves.R
Useful for drawing the estimated functions grouped by color and the centroids (mean curve of the curves pertaining to the same group).
1 2 3 4 5 6 7 8 9 10 11 12 |
object |
Object of |
groups_by_colour |
A specification for the plotting groups by color. |
centers |
Draw the centroids (mean of the curves pertaining to the
same group) into the plot. By default it is |
conf.int |
Only for survival curves. Logical flag indicating whether to plot confidence intervals. |
censor |
Only for survival curves. Logical flag indicating whether to plot censors. |
xlab |
A title for the |
ylab |
A title for the |
interactive |
Logical flag indicating if an interactive plot with plotly is produced. |
... |
Other options. |
See help page of the function autoplot.survfit
.
A ggplot object, so you can use common features from ggplot2 package to manipulate the plot.
Nora M. Villanueva and Marta Sestelo.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | library(survival)
library(clustcurv)
library(condSURV)
library(ggplot2)
library(ggfortify)
# Survival
data(veteran)
data(colonCS)
cl2 <- ksurvcurves(time = veteran$time, status = veteran$status,
x = veteran$celltype, k = 2, algorithm = "kmeans")
autoplot(cl2)
autoplot(cl2, groups_by_colour = FALSE)
autoplot(cl2, centers = TRUE)
# Regression
r2 <- kregcurves(y = barnacle5$DW, x = barnacle5$RC,
z = barnacle5$F, k = 2, algorithm = "kmeans")
autoplot(r2)
autoplot(r2, groups_by_colour = FALSE)
autoplot(r2, groups_by_colour = FALSE, interactive = TRUE)
autoplot(r2, centers = TRUE)
colonCSm <- data.frame(time = colonCS$Stime, status = colonCS$event,
nodes = colonCS$nodes)
table(colonCSm$nodes)
colonCSm$nodes[colonCSm$nodes == 0] <- NA
colonCSm <- na.omit(colonCSm)
colonCSm$nodes[colonCSm$nodes >= 10] <- 10
table(colonCSm$nodes) # ten levels
res <- survclustcurves(time = colonCSm$time, status = colonCSm$status,
x = colonCSm$nodes, algorithm = "kmeans", nboot = 20)
autoplot(res)
autoplot(res, groups_by_colour = FALSE)
autoplot(res, centers = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.