normalize_counts: This function normalizes the raw otu counts by participant to...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

normalize_counts totals the amount of bugs for each particpant and divides each otu by that toal

Usage

1
normalize_counts(otu_count)

Arguments

otu_count

A data frame including the raw counts for each bug and participant.

Details

no further details

Value

The output is a data frame in the same format as the input.

Author(s)

atomczik

See Also

abundance_crop

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (otu_count) 
{
    otu.normed = otu_count
    index = names(otu.normed)
    myIndex <- length(index)
    n <- length(row.names(otu.normed))
    m <- length(otu.normed)
    for (i in 1:m) {
        col = index[i]
        n <- length(row.names(otu.normed))
        otu.normed[1:n, i] <- (otu.normed[1:n, i])/sum(otu.normed[1:n, 
            i])
    }
    return(otu.normed)
  }

dlemas/microbes documentation built on May 15, 2019, 9:15 a.m.