matrify: Create Taxon Data.Frames From Three Column Database Form
Description
Takes a data.frame in three column form (sample.id, taxon,
abundance) and converts it into full matrix form, and then exports it as
data.frame with the appropriate row.names and column names.
Usage
matrify(data)
Arguments
data
a data.frame or matrix in three column format (or database
format), where the first column is the sample ID, the second column is the taxon
ID, and the third sample is the abundance of that taxon in that sample.
Value
a data.frame with samples as rows, taxa as columns, and abudance values
for taxa in samples.
Details
The routine is pure R code to convert data from database form to the sparse
matrix form required by multivariate analyses in packages ‘labdsv’ and
‘vegan’, as well as dist and other routines.