Merge groups into one group.

mergeGroups(
  object,
  grouping_variable,
  grouping_variable_new,
  keep = NULL,
  drop = NULL,
  new_group = "other",
  verbose = NULL
)

Arguments

object

An object of class spata2.

grouping_variable

Character value. The grouping variable whose groups are supposed to be merged.

grouping_variable_new

Character value or NULL. If character, the results are stored in a new variable named accordingly. If NULL, the grouping variable is updated - DE analysis results will be discarded.

keep

Character vector or NULL. If character, specifies the groups that are supposed to remain as they are. Every other group is lumped together.

new_group

Character value. The new group name of the merge.

verbose

Logical. If set to TRUE informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

merge

Character vector or NULL. If character, specifies the groups that are merged together.

Details

Only one argument of keep or merge must be specified. If grouping_variable_new is NULL DE analysis results of the specified grouping variable is resetted.