Multinomial: Generation of Multinomial Random Samples

Description Usage Arguments Details Value Examples

View source: R/Multinomial.R

Description

It generates a data matrix with random samples from a multinomial distribution where the rows are the samples and the columns are the taxa.

Usage

1
Multinomial(Nrs, probs)

Arguments

Nrs

A vector specifying the number of reads or sequence depth for each sample.

probs

A vector specifying taxa probabilities.

Details

Note: Though the test statistic supports an unequal number of reads across samples, the performance has not yet been fully tested.

Value

A data matrix of taxa counts where the rows are the samples and the columns are the taxa.

Examples

1
2
3
4
5
6
7
8
9
	### Generate the number of reads per sample
	### The first number is the number of reads and the second is the number of subjects
	nrs <- rep(15000, 25)
	
	### Create a probability vector
	probs <- c(0.4, 0.3, 0.2, .05, 0.04, .01)
	
	mData <- Multinomial(nrs, probs)
	mData[1:5, 1:5]

HMP documentation built on Aug. 31, 2019, 5:05 p.m.