If a 'mefa' object is aggregated, either or both tables for samples and taxa (depending on if the aggregation was made by rows, columns or both) are set to NULL
. Because aggregation is not straightforward for data frames with mixed type of data (e.g. factors, character vectors), and the applied function (mean, sum, etc.) depends on the type of the numeric variables. Consequently, if new data table is needed, that must be defined again by the function mefa
. If the original data frame contained only numeric columns, it can be easily aggregated if the function to apply is known. For factors and numeric columns, however, such aggregation is not defined.
The ordering of dimensions follow the ordering of the indices in the extraction call, except for nested subsets, when sequence of nested segments is not allowed to be affected by the extraction (error message is given). The extracting method retains samples and taxa tables as well. If non-nested segments are extracted, the x$xtab
matrix will contain the sum of segments, and not the original values of x$xtab
. Thus if a resulting 'mefa' object has only one segment, it will be identical to the x$xtab
matrix. If nested segments are extracted, x$xtab
will be identical to the last segment and not the sum of segments. See the examples for these differences. If the original object had nested segments and the first is excluded, segment names change as a result. If only one segment remains in the result, the nested attribute is turned off.
If the aggregation is done over a vector that is not part of the tables inside the 'mefa' object, it must have a class attribute to be recognised, use e.g. the as.factor
function (see 'Examples').
The resulting 'mefa' object must contain at least 2 samples and 2 taxa.
Extractor functions xtab
, samp
, taxa
, and segm
extract the corresponding element from the 'mefa' object.