mult_dist_average: Average multiple distance matrices.

View source: R/phyloseq_mult_dist.R

mult_dist_averageR Documentation

Average multiple distance matrices.

Description

This function can be used in order to avergage beta diversity over multiple rarefaction iterations.

Usage

mult_dist_average(dlist)

Arguments

dlist

List of distance matrices (class 'dist' or 'matrix')

Value

Distance matrix of the same class as input matrices ('dist' or 'matrix') with averaged values.

Examples

library(plyr)
# Generate dummy data (list with 3 5x5 matrices)
ddd <- rlply(.n = 3, .expr = function(){ as.dist( matrix(sample(1:1000, size = 25, replace = T), ncol = 5)) })
ddd

# Average matrices
mult_dist_average(ddd)


vmikk/metagMisc documentation built on June 20, 2024, 7:20 a.m.