Description Usage Arguments Details Value Examples
View source: R/geom_survTicks.R
Imports: ggplot2
1 | geom_survTicks(data, mapping, ticks = "segment", ...)
|
data |
The data to be displayed in this layer. There are three options: If A A |
mapping |
aes object, created with aes(). Provide x (time) and y (status). Optionally you can provide color and linetype to distinguish conditions. For the status: NA will be irgnored, 1 = dropped out, 2 = dead, any other value = alive. |
ticks |
character, either "segment" or "point". If specified as "point", additional geom_point options can be specified, such as shape |
... |
Other arguments passed on to |
calls the geom_surve function but only uses the ticks, not the lines
a ggplot2 layer object (geom_segment for the ticks) that can directly be added to a ggplot2 object
1 2 3 4 5 6 7 8 9 10 11 12 | library(ggsurvival)
library(ggplot2)
survtest <- data.frame(
time = sample(seq(30),50,replace = T),
status = sample(1:2, 50, replace = T),
condition = sample(c("wt","ko"), 50, replace = T)
)
ggplot() +
geom_survLines(survtest, aes(time, status, color=condition))
geom_survTicks(survtest, aes(time, status, color=condition))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.