Sets the ordering of the groups in a grouping variable. Affects the order in which they appear in plots.

relevelGroups(object, grouping_variable, new_levels)

Arguments

object

An object of class spata2.

grouping_variable

Character value. The grouping variable of interest. Use getGroupingOptions() to obtain all valid input options.

new_levels

Character vector of group names in the order in which the new ordering is supposed to be stored. Must contain all groups of the grouping variable.

Value

An updated spata object.