nonzero | R Documentation |
This function calculates the proportion of non-zero values (prevalence) for each response and plots the proportions.
nonzero(y, total, min.p=0, sort=TRUE, plot=FALSE)
y |
a matrix of responses; each column is a response and rows are samples. |
total |
optional. It is total number (total reads in microbiome data). If not provided, the number is calculated as the column sum of |
min.p |
a value in [0, 1). The responses with the proportion of non-zero values > min.p are returned. |
sort |
sort by the nonzero proportions of the responses into decreasing order. |
plot |
plot zero proportion and total number or not. |
Proportions of non-zero values (i.e. prevalence) for responses: nonzero.p
, total numbers for all samples: total
, mean and standard deviation of total numbers: total_mean_sd
, filtered responses: y.filter
, and plots of ordered proportions of zero values and total numbers.
Nengjun Yi, nyi@uab.edu
library(NBZIMM)
data(Romero)
names(Romero)
otu = Romero$OTU; dim(otu)
sam = Romero$SampleData; dim(sam)
colnames(sam)
N = sam[, "Total.Read.Counts"] # total reads
non = nonzero(y=otu, total=N, plot=T)
names(non)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.