matrix2dataframe {rscc} | R Documentation |
matrix2dataframe
Description
Converts a numeric matrix to a data frame with decreasing or increasing values: First column row index, second column col index and third column the value. If the matrix is symmetric, only the upper triangle is taken into account.
Usage
matrix2dataframe(
m,
decreasing = TRUE,
tol = 100 * .Machine$double.eps,
tol1 = 8 * tol,
...
)
Arguments
m |
numeric: a matrix of values |
decreasing |
logical: should the sort order be increasing or decreasing (default: |
tol |
numeric scalar >= 0. Smaller differences are not
considered, see |
tol1 |
numeric scalar >= 0. |
... |
further arguments passed to methods; the matrix method
passes these to |
Value
a data frame with an attribute matrix
with m
Examples
# non-symmetric
x <- matrix(runif(9), ncol=3)
matrix2dataframe(x)