make_annotation_labels: Create a column of formatted labels from one of disparate...

View source: R/annotation_table.R

make_annotation_labelsR Documentation

Create a column of formatted labels from one of disparate numeric values.

Description

This function looks in a character column for a regex that indicates whether a row is a percentage or a whole number. It then prettily formats the contents of a numeric column as either a percentage or a comma-separated int.

Usage

make_annotation_labels(.x, .rate_key = "Rate")

Arguments

.x

a tibble with fields “Measure“ and “Value“.

.rate_key

a string in the Measure name that indicates a percentage

Value

a tibble with a new column, “Label“, that is formatted.

Examples

make_annotation_labels(
    tibble::tribble(~Measure, ~Value,
                     "R",      0.5,
                     "K",      1000,
                     "A",      42),
    "R"
)

higherX4Racine/hiRx documentation built on Nov. 18, 2024, 10:20 a.m.