perturb: Compositionally perturb a relative-abundance matrix

Description Usage Arguments Details See Also

View source: R/calibrate.R

Description

The perturbation of two compositional vectors v and y is given (up to compositional equivalence) by the elementwise product v * y.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
perturb(x, y, ...)

## S3 method for class 'matrix'
perturb(x, y, margin, norm = "close")

## S3 method for class 'otu_table'
perturb(x, y, norm = "close")

## S3 method for class 'phyloseq'
perturb(x, y, norm = "close")

## S3 method for class 'mc_bias_fit'
perturb(x, y)

Arguments

x

An abundance matrix or phyloseq object containing one

y

A numeric vector with which to perturb the observations in x

margin

Matrix margin that corresponds to observations (samples); 1 for rows, 2 for columns

norm

String specifying how to normalize the perturbed observations; see Details.

Details

Let w = v * y, where v is a row or column of x. The normalization options specified by the norm argument are

If y is named, then the names must agree with the taxa names in x and will be used to reorder y to match the taxa order in x.

See Also

calibrate()


mikemc/metacal documentation built on Feb. 20, 2022, 1:46 a.m.