conversions {SARP.compo} | R Documentation |
Convert between matrix and data-frame format
Description
These functions convert all pairwise ratio tests between the matrix format and the data.frame format
Usage
Mp.DFp(DFp, col.noms = c( 1, 2 ), col.p = 'p')
Arguments
DFp |
Results in the data.frame format. |
col.noms |
A length two character vector giving the columns in the data.frame format that contain the names of the two components of which the ratio is tested. If converting from a data.frame, can be given by number. |
col.p |
A length one character vector giving the column containing the p-values of the test in the data.frame format. If converting from a data.frame, can be given by number. |
Details
The matrix format is more convenient for manipulations like finding cut-off probabilities or building the hierarchical tree of the components. However, it can only store one value per couple and is more memory consuming.
The data.frame format is more efficient for computations, since it
allows to store several results at once. It can also be easily saved
and read using text-files and read.table
or
write.table
. However, finding the hierarchical tree of
components or building the graph is not so straightforward.
These utilitary functions allow to convert between the two formats.
Value
The results in the other format: a matrix for Mp.DFp
and a
3-columns data.frame for DFp.Mp
.
In the matrix form, components will be sorted by alphabetical order.
Warning
When converting a data.frame to a matrix, there is no control that all possible combinations are present once, and only once, in the data.frame. Missing combinations will have 0 in the matrix; combinations present several time will have the value of the last replicate.
When converting a matrix to a data.frame, the diagonal is not included in the data.frame. The matrix is expected to be symmetric, and only the upper right part is used.
Author(s)
Emmanuel Curis (emmanuel.curis@parisdescartes.fr)
See Also
creer.Mp
to create a matrix of p-values for all
possible ratios of a compositional vector.
creer.DFp
to create a data.frame of p-values for
all possible ratios of a compositional vector.
Examples
# load the potery data set data( poteries )