Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

seriation_methods

Registry for Seriation Methods


Description

A registry to manage methods for seriation.

Usage

list_seriation_methods(kind)
show_seriation_methods(kind)
get_seriation_method(kind, name)
set_seriation_method(kind, name, definition, description = NULL, control = list(), ...)

Arguments

kind

the data type the method works on. For example, "dist", "matrix" or "array". If missing, then methods for any type are shown.

name

a short name for the method used to refer to the method in seriate().

definition

a function containing the method's code.

description

a description of the method. For example, a long name.

control

a list with control arguments and default values.

...

further information that is stored for the method in the registry.

Details

The functions below are convenience function for the registry registry_seriate.

list_seriation_method() lists all available methods for a given data type (kind). The result is a vector of character strings with the short names of the methods.

show_seriation_method() shows all available methods including a description.

get_seriation_method() returns information (including the implementing function) about a given method in form of an object of class "seriation_method".

With set_seriation_method() new seriation methods can be added by the user. The implementing function (definition) needs to have the formal arguments x, control, where x is the data object and control contains a list with additional information for the method passed on from seriate(). The implementation has to return a list of objects which can be coerced into ser_permutation_vector objects (e.g., integer vectors). The elements in the list have to be in corresponding order to the dimensions of x.

Author(s)

Michael Hahsler

Examples

## registry
registry_seriate

## convenience functions
show_seriation_methods()
show_seriation_methods("matrix")

list_seriation_methods("matrix")

get_seriation_method(name = "BEA")

## define a new method

## create a identity function which returns the identity order
seriation_method_identity <- function(x, control) {
   lapply(dim(x), seq)
}

## set new method
set_seriation_method("matrix", "identity", seriation_method_identity,
    "Identity order")

set_seriation_method("array", "identity", seriation_method_identity,
    "Identity order")

show_seriation_methods("matrix")

##use all criterion methods (including the new one)
seriate(matrix(1:12, ncol=3), "identity")

seriation

Infrastructure for Ordering Objects Using Seriation

v1.2-9
GPL-3
Authors
Michael Hahsler [aut, cre, cph], Christian Buchta [aut, cph], Kurt Hornik [aut, cph], Fionn Murtagh [ctb, cph], Michael Brusco [ctb, cph], Stephanie Stahl [ctb, cph], Hans-Friedrich Koehn [ctb, cph]
Initial release
2020-09-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.