View source: R/custom.subsets.R
custom.subsets | R Documentation |
Splits the data into a customized subsets list.
custom.subsets(data, group, tree)
data |
A |
group |
Either a |
tree |
Optional, a |
Note that every element from the input data can be assigned to multiple groups!
Thomas Guillerme
chrono.subsets
, boot.matrix
, dispRity
, crown.stem
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.