canonicalize set and mapping | R Documentation |
Helper function that canonicalizes set elements, and possibly reorders a given mapping accordingly.
canonicalize_set_and_mapping(x, mapping = NULL, margin = NULL)
x |
An object to be transformed into a set. |
mapping |
A list, array or data frame representing a mapping of the set. |
margin |
Margins to be reordered (ignored if |
This helper function can be used when a set is to be created from some
object x
, and another object contains some meta-information
on the set elements in the same order than the elements
of x
. The set creation can cause the input elements to be
permuted. By the use of this function, the meta information can be kept in
sync with the result of iterating over the associated set.
A list with three named components:
set |
The set created from |
mapping |
|
order |
The order used for rearranging the mapping. |
set
.
L <- list(c, "a", 3)
M1 <- list("a","b","c")
M2 <- matrix(1:9, ncol = 3)
canonicalize_set_and_mapping(L, M1)
canonicalize_set_and_mapping(L, M2)
canonicalize_set_and_mapping(L, M2, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.