Skip to contents

This function formats the labels for the given compositions based on the legacy status and index. The function is designed to work within a dplyr pipeline.

Usage

format_labels(
  data,
  legacy_col = "legacy",
  label_col = "label",
  index_col = "index"
)

Arguments

data

A tibble containing the compositions to be labeled. The dataframe should contain the columns legacy, label, and index.

legacy_col

The name of the column that contains the legacy flag. Default is "legacy".

label_col

The name of the column that contains the labels. Default is "label".

index_col

The name of the column that contains the index. Default is "index".

Value

A tibble containing the formatted labels.

Examples

df <- tibble(legacy = c(1, 0), label = c("S1", "S2"), index = c(1, 2))
#> Error in tibble(legacy = c(1, 0), label = c("S1", "S2"), index = c(1,     2)): could not find function "tibble"
df %>% format_labels()
#> Error in df %>% format_labels(): could not find function "%>%"