# Registry
registry_seriate
# List all seriation methods by type
list_seriation_methods()
# List methods for matrix seriation
list_seriation_methods("matrix")
get_seriation_method(name = "BEA")
# Example for defining a new seriation method (reverse identity function for matrix)
# 1. Create the seriation method: Reverse the row order
# (NA means no seriation is applied to columns)
seriation_method_reverse_rows <- function(x, control = NULL, margin = c(1, 2)) {
list(rev(seq(nrow(x))), NA)[margin]
}
# 2. Register new method
set_seriation_method("matrix", "Reverse_rows", seriation_method_reverse_rows,
description = "Reverse identity order", control = list())
list_seriation_methods("matrix")
get_seriation_method("matrix", "reverse_rows")
# 3. Use the new seriation methods
seriate(matrix(1:12, ncol = 3), "reverse_rows")
Run the code above in your browser using DataLab