surv.scale: Plots a survival color scale, for legend

Description Usage Arguments Author(s) See Also Examples

View source: R/surv.scale.r

Description

This function plots a color scale using a custom color palette, to legend surv.colors annotations.

Usage

1
2
  surv.scale(time, event, eventColors = c("#000000", "#CCCCCC"),
    censColors = c("#FFFFEE", "#FFDD00"))

Arguments

time

Numeric vector, the follow-up times of each individual (see Surv in the survival package).

event

Logical vector, whether an event (death, relapse ...) occured at the end of each individual follow-up or not (see Surv in the survival package).

eventColors

Character vector of length 2, the boundaries of the color scale to generate for individuals with events.

censColors

Character vector of length 2, the boundaries of the color scale to generate for right-censored individuals.

Author(s)

Sylvain Mareschal

See Also

surv.colors, survival::Surv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  # Rosenwald's dataset (hand-picked prognostic probes)
  data(rosenwald)
  probes <- c("30580", "16006", "32315", "16978", "26588")
  expr <- t(rosenwald.expr[ probes ,])
  
  # NA imputation (feature's mean to minimize impact)
  f <- function(x) { x[ is.na(x) ] <- round(mean(x, na.rm=TRUE), 3); x }
  expr <- apply(expr, 2, f)
  
  # Survival colors
  surv <- with(rosenwald.cli, surv.colors(time=follow.up, event=status=="Dead"))
  
  # Annotated clustering
  side <- data.frame(OS=surv, row.names=rownames(rosenwald.cli))
  clusterize(expr, side=side)
  
  # Color scale legend
  with(rosenwald.cli, surv.scale(time=follow.up, event=status=="Dead"))

LPS documentation built on May 29, 2021, 5:07 p.m.