renameGroups.Rd
Allows to rename groups within a grouping variable. Make sure
to rename tissue sections with renameTissueSection()
!
renameGroups(object, grouping, ..., keep_levels = NULL)
renameTissueSection(object, ...)
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 of interest. Use
getGroupingOptions()
to obtain all valid input options.
The groups to be renamed specified according to the following
syntax: 'new_group_name' =
'old_group_name'.
library(SPATA2)
data("example_data")
## Example 1 - rename normal grouping variables
object <- example_data$object_UKF269T_diet
plotSurface(object, color_by = "histology")
object <-
renameGroups(
object = object,
grouping = "histology",
"hist1" = "tumor", "hist2" = "transition", "hist3" = "infiltrated"
)
plotSurface(object, color_by = "histology")
## Example 2 - rename tissue secions
object <- example_data$object_lmu_mci_diet
object <- identifyTissueOutline(object)
plotSurface(object, color_by = "tissue_section")
object <-
renameTissueSection(
object = object,
"lower_hemisphere" = "tissue_section_1", "upper_hemisphere" = "tissue_section_2"
)
plotSurface(object, color_by = "tissue_section")