typeConvert {otuSummary}R Documentation

Transpose the data frame if there is data type conversion.

Description

function to transpose the data frame if there is data type conversion.

Usage

typeConvert(otutab,taxhead = NULL)

Arguments

otutab

An OTU table, which can contain no taxonomy. The OTU table can be given in numeric counts or in relative abundance.

taxhead

Character, specify the header of taxonomy. By default the taxonomic column is NULL.

Details

This function is to convert the numeric values into right type so that the downstream numeric calculation could be processed without type error.

Value

This function returns a transposed OTU table. In the source OTU table the numeric values showing "character" or "factor" will be converted to right types.

Author(s)

Sizhong Yang <yanglzu@163.com>

Examples

data(otu4type)
sapply(otu4type, class)
new <- typeConvert(as.data.frame(t(otu4type)), taxhead = "taxonomy")
sapply(new, class)

[Package otuSummary version 0.1.2 Index]