Learn R Programming

otuSummary (version 0.1.1)

typeConvert: 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)

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.

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.

Author

Sizhong Yang <yanglzu@163.com>

Details

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

Examples

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

Run the code above in your browser using DataLab