get_indiv_surv.Rd
Converts bulk survival data (multiple observations per row) to individual survival data (one observation per row)
get_indiv_surv(sample_data, sample_order = unique(sample_data$condition))
A data.frame
object with 4 columns. Column headers
must be ("condition", "day", "dead", "censored").
character
, conditions to plot, in order.
Default: unique(sample_data$condition). To subset, use sample_order = c("WT", "Drug1")
A tibble
for lifespan by individual.
Contains 3 columns: condition
, day
, status
.
Status: 1 = dead, 0 = censored.
# Default (alphabetical order)
df_isurv <- get_indiv_surv(sample_data)
#> Joining with `by = join_by(x, condition, day, sex, status)`
# Plot samples in a fixed order
df_isurv <- get_indiv_surv(sample_data,
sample_order = c("WT", "Drug1", "Drug2"))
#> Joining with `by = join_by(x, condition, day, sex, status)`
# Subset only 2 conditions
df_isurv <- get_indiv_surv(sample_data,
sample_order = c("WT", "Drug1"))
#> Joining with `by = join_by(x, condition, day, sex, status)`