mapLabels: Re-map a character vector of labels from an old set of labels...

View source: R/HelperUtils.R

mapLabelsR Documentation

Re-map a character vector of labels from an old set of labels to a new set of labels

Description

This function takes a character vector of labels and uses a set of old and new labels to re-map from the old label set to the new label set.

Usage

mapLabels(labels = NULL, newLabels = NULL, oldLabels = names(newLabels))

Arguments

labels

A character vector containing lables to map.

newLabels

A character vector (same length as oldLabels) to map labels to from oldLabels.

oldLabels

A character vector (same length as newLabels) to map labels from to newLabels

Examples


# Get Test ArchR Project
proj <- getTestProject()

# Get Peak Annotations
proj$ClusterLabels <- mapLabels(proj$Clusters, c("T", "B", "M"), c("C1", "C2", "C3"))


GreenleafLab/ArchR documentation built on Feb. 21, 2025, 3:05 p.m.