SFS_read {SFS} | R Documentation |
Read similarity or dissimilarity input data
Description
Read the similarity (or dissimilarity) information between the objects that one wants to order and build a 3-columns data frame
, where each row represents the (dis)similarity
between objects
and
. In case of symmetric data (i.e.,
), only the entries for pairs
with
are listed.
Usage
read(data, zero_epsilon = 1e-200, symmetric = TRUE, identical_val = FALSE)
Arguments
data |
a representation of the similarity (or dissimilarity) between pairs of objects. |
zero_epsilon |
a numerical value which determines that values in |
symmetric |
a boolean value equal to |
identical_val |
a boolean value equal to |
Details
The input data can be a weighted adjacency matrix (represented by the objects: matrix
, dist
or data frame
), or a list of all the weighted edges of a weighted graph (represented by a 3-col data frame
) where each row represents the (dis)similarity
between objects
and
with
). If not specified, the data is assumed to be symmetric (i.e., same entry at positions
and
). Since by default the data is assumed to be symmetric, if it is represented by a 3-columns
data frame
, then it is assumed that symmetric pairs are not listed, and thus by default identical_val = FALSE
. The reason for this choice is that for large symmetric data, it is more efficient to list the symmetric entries only once.
However, note that if symmetric = FALSE
then identical_val = TRUE
automatically.
Value
Returns a 3-columns data frame
representation of the original data listing all the pairwise (dis)similarities between objects and selecting only the entries
with
when the data is a symmetric matrix
.
Author(s)
Matteo Seminaroti (SFS) and Utz-Uwe Haus (R wrapping)