collapseGenes: Collapse a vector of gene names

View source: R/collapseGenes.R

collapseGenesR Documentation

Collapse a vector of gene names

Description

Collapse a vector of gene names

Usage

collapseGenes(
  x,
  sort = TRUE,
  dedup = TRUE,
  format = "_",
  sep = ", ",
  last = " and ",
  numeric = TRUE,
  width = Inf,
  ...
)

Arguments

x

character vector representing gene names

sort

logical(1) Should the names be sorted alphabetically

dedup

logical(1) Should duplicate names be removed

format

character string for markdown formatting of each element

sep

separator between vector elements

last

character string to place before the last element

numeric

logical(1) sort digits numerically, instead of as strings

width

The maximum width of the string before truncating to ...

...

passed to str_sort

Details

Convenience function to collapse a vector of gene names into a character/glue object of length 1. By default, symbols are deduplicated, sorted alpha-numerically and italicised with an underscore.

Value

a glue object

Examples

genes <- c("FOXP3", "BRCA1", "TP53")
collapseGenes(genes)


steveped/chipExtra documentation built on Aug. 1, 2024, 12:33 a.m.