coalesce_labels: Join classification labels into one

View source: R/Model.R

coalesce_labelsR Documentation

Join classification labels into one

Description

In the same Annotation file, there could be multiple classification labels for a record derived by different phases of the labelling procedure. This function joins them hierarchically, using the label from the lower hierarchies to fill up NAs in the upper ones. The hierarchy is considered from left to right.

Usage

coalesce_labels(
  data,
  label_cols = c("Rev_prediction_new", "Rev_prediction", "Rev_manual")
)

Arguments

data

An Annotation data frame.

label_cols

The label columns to coalesce. They are considered hierarchically from left to right, with a lower level column being used if a value is missing in the upper level one.

Details

This function is a wrapper over dplyr::coalesce() which allow to have a standard coalescing scheme for an annotation file.

Value

A vector with the coalesce labels.


bakaburg1/BaySREn documentation built on March 30, 2022, 12:16 a.m.