mergeGroups.Rd
Merge groups into one group.
mergeGroups(object, grouping, grouping_new, merge, new_group, verbose = NULL)
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
Character value. The grouping variable whose groups are supposed to be merged.
Character value or NULL. If character, the results are stored in a new variable named accordingly. If NULL, the grouping variable is updated - DEA results will be discarded.
Character vector or NULL. If character, specifies the groups that are merged together.
Character value. The new group name of the merge.
Logical. If TRUE
, informative messages regarding
the computational progress will be printed.
(Warning messages will always be printed.)
Only one argument of keep
or merge
must be specified.
If grouping_new
is NULL DEA results of the specified
grouping variable is resetted.
library(SPATA2)
library(tidyverse)
object <- loadExampleObject("UKF275T", meta = TRUE)
object <-
mergeGroups(
object = object,
grouping = "bayes_space",
grouping_new = "bayes_space_merged",
merge = c("B1", "B6"),
new_group = "B1B6_merged"
)
plotSurface(object, color_by = "bayes_space")
plotSurface(object, color_by = "bayes_space_merged")