custom.subsets {dispRity} | R Documentation |
Separating data into custom subsets.
Description
Splits the data into a customized subsets list.
Usage
custom.subsets(data, group, tree = NULL)
Arguments
data |
A |
group |
Either a |
tree |
|
Details
Note that every element from the input data can be assigned to multiple groups!
Author(s)
Thomas Guillerme
See Also
chrono.subsets
, boot.matrix
, dispRity
, crown.stem
.
Examples
## Generating a dummy ordinated matrix
ordinated_matrix <- matrix(data = rnorm(90), nrow = 10)
## Splitting the ordinated matrix into two groups using row numbers
custom.subsets(ordinated_matrix, list(c(1:4), c(5:10)))
## Splitting the ordinated matrix into three groups using row names
ordinated_matrix <- matrix(data = rnorm(90), nrow = 10,
dimnames = list(letters[1:10]))
custom.subsets(ordinated_matrix,
list("A" = c("a", "b", "c", "d"), "B" = c("e", "f", "g", "h", "i", "j"),
"C" = c("a", "c", "d", "f", "h")))
## Splitting the ordinated matrix into four groups using a dataframe
groups <- as.data.frame(matrix(data = c(rep(1,5), rep(2,5), rep(c(1,2), 5)),
nrow = 10, ncol = 2, dimnames = list(letters[1:10], c("g1", "g2"))))
custom.subsets(ordinated_matrix, groups)
## Splitting a matrix by clade
data(BeckLee_mat50)
data(BeckLee_tree)
custom.subsets(BeckLee_mat50, group = BeckLee_tree)
[Package dispRity version 1.8 Index]