h_xticks {tern} | R Documentation |
Helper function to calculate x-tick positions
Description
Calculate the positions of ticks on the x-axis. However, if xticks
already
exists it is kept as is. It is based on the same function ggplot2
relies on,
and is required in the graphic and the patient-at-risk annotation table.
Usage
h_xticks(data, xticks = NULL, max_time = NULL)
Arguments
data |
( |
xticks |
( |
max_time |
( |
Value
A vector of positions to use for x-axis ticks on a ggplot
object.
Examples
library(dplyr)
library(survival)
data <- tern_ex_adtte %>%
filter(PARAMCD == "OS") %>%
survfit(formula = Surv(AVAL, 1 - CNSR) ~ ARMCD, data = .) %>%
h_data_plot()
h_xticks(data)
h_xticks(data, xticks = seq(0, 3000, 500))
h_xticks(data, xticks = 500)
h_xticks(data, xticks = 500, max_time = 6000)
h_xticks(data, xticks = c(0, 500), max_time = 300)
h_xticks(data, xticks = 500, max_time = 300)
[Package tern version 0.9.5 Index]