Skip to contents

Collapse provided PANGO lineage names completely or up to a maximum depth. Recombinant variants will not be collapsed. NA_character values will be carried through.

Usage

collapse_pangoro(
  pangoro,
  input,
  max_level = NULL,
  simplify = TRUE,
  aliase_parent = FALSE
)

Arguments

pangoro

Pangoro object.

input

Vector of lineage names to collapse (character vector).

max_level

How far to expand the lineage name (default: maximum).

simplify

Boolean, pass to mapply.

aliase_parent

Boolean, to use alias code for originating parent (e.g. BQ.1.10.1 -> EC)

Examples

if (FALSE) {
my_pangoro <- pangoro()
x <- c('B.1.1.529.1', 'B.1.1.529.2.75.1.2', 'BA.1', NA_character_)
collapse_pangoro(my_pangoro, x)
collapse_pangoro(my_pangoro, x, 1)
collapse_pangoro(my_pangoro, x, 2)
}