color_lab_values: Mapping function for Laboratory Table

View source: R/utils.R

color_lab_valuesR Documentation

Mapping function for Laboratory Table

Description

Map value and level characters to values with with proper html tags, colors and icons.

Usage

color_lab_values(
  x,
  classes = c("HIGH", "NORMAL", "LOW"),
  colors = list(HIGH = "red", NORMAL = "grey", LOW = "blue"),
  default_color = "black",
  icons = list(HIGH = "glyphicon glyphicon-arrow-up", LOW =
    "glyphicon glyphicon-arrow-down")
)

Arguments

x

(character)
vector with elements under the format (⁠value level⁠).

classes

(character)
classes vector.

colors

(list)
color per class.

default_color

(character)
default color.

icons

(list)
certain icons per level.

Value

a character vector where each element is a formatted HTML tag corresponding to a value in x.

Examples

color_lab_values(c("LOW", "LOW", "HIGH", "NORMAL", "HIGH"))


teal.modules.clinical documentation built on April 4, 2025, 12:35 a.m.