Skip to contents

Compute MPQr distances for a range of values of r

Usage

get_mpq_distances(X, tr, rvec = r_transform(0:100/100))

Arguments

X

A n x p data matrix.

tr

A tree (of class phylo) with p leaves.

rvec

A vector of values between 0 and 1. For each value in this vector, the function will compute a distance matrix corresponding to the MPQr distance for that value of r. Defaults to a set of values of r that are spaced more closely close to 0 and 1 and more widely around .5 by applying r_transform to equally spaced values between 0 and 1.

Value

A list of length 2 whose elements are named distances and r. distances is a list of length length(rvec), and each element contains a distance object giving the MPQr distances between the rows of X for one value of r. The second element of the list (r) gives the values of r that were used for computing the MPQr distances. These values are given in the same order as the distance objects in the distance element of the list.

Examples

data(small_otutab)
data(small_tree)
mpq_distances <- get_mpq_distances(small_otutab, small_tree, rvec = c(0,.5,1))
class(mpq_distances$distance[[1]])
#> [1] "dist"