Learn R Programming

dispRity (version 1.5.0)

custom.subsets: Separating data into custom subsets.

Description

Splits the data into a customized subsets list.

Usage

custom.subsets(data, group)

Arguments

data

A matrix or a list of matrices.

group

Either a list of row numbers or names to be used as different groups or a data.frame with the same \(k\) elements as in data as rownames. If group is a phylo object matching data, groups are automatically generated as clades.

Value

This function outputs a dispRity object containing:

matrix

the multidimensional space (a matrix).

call

A list containing the called arguments.

subsets

A list containing matrices pointing to the elements present in each subsets.

Use summary.dispRity to summarise the dispRity object.

Details

Note that every element from the input data can be assigned to multiple groups!

See Also

chrono.subsets, boot.matrix, dispRity, crown.stem.

Examples

Run this code
# NOT RUN {
## 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)


# }

Run the code above in your browser using DataLab