Learn R Programming

HMP (version 2.0.1)

Multinomial: Generation of Multinomial Random Samples

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

Multinomial(Nrs, probs)

Arguments

Nrs

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

probs

A vector specifying taxa probabilities.

Value

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

Details

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

Examples

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

Run the code above in your browser using DataLab