
Reorganize longitudinal microbiome into a data cube ready for PARAFAC modelling.
Source:R/reshapeData.R
reshapeData.Rd
Reorganize longitudinal microbiome into a data cube ready for PARAFAC modelling.
Arguments
- Xlong
Longitudinal microbiome count data in matrix (long) format.
- subjectMetadata
Vector containing the subjects corresponding to the measurements in Xlong.
- featureMetadata
Taxonomic classification of the microbiota, ordered the same as the columns in Xlong.
- timepointMetadata
Vector containing the time points corresponding to the measurements in Xlong.
- timepointOrder
Vector containing the required order of the timepoints in timepointMetadata (default: sort(unique(timepointMetadata)) ).
Value
#' A list object containing
- data
Array object of the data cube
- mode1
Dataframe with the subjects, ordered the same as the rows in the data cube.
- mode2
Taxonomic classification of the microbiota, ordered the same as the columns in the data cube.
- mode3
Dataframe with the time metadata, ordered the same as the third dimension in the data cube.
...