sMatrix | R Documentation |
C++ implementation to compute the s-matrix (the weighted Jaccard similarity matrix) for a (sparse) input matrix as in the 'Stego' package: https://github.com/dschlauch/stego
sMatrix(m, useCpp = TRUE, sparse = TRUE, Djac = FALSE, phased = FALSE)
m |
A (sparse) matrix for which the s-matrix is sought. The input matrix is assumed to be oriented to contain the data for one individual per column. |
useCpp |
Flag to switch between R or C++ implementations. Default is |
sparse |
Flag to switch between purpose-built dense or sparse implementations. Default is |
Djac |
Flag to switch between the unweighted ( |
phased |
Boolean flag to indicate if the input matrix is phased. Default is |
The s-matrix (the weighted Jaccard matrix) of m
.
Daniel Schlauch (2016). Implementation of the stego algorithm - Similarity Test for Estimating Genetic Outliers. https://github.com/dschlauch/stego
require(locStra) require(Matrix) m <- matrix(sample(0:1,15,replace=TRUE),ncol=3) sparseM <- Matrix(m,sparse=TRUE) print(sMatrix(sparseM))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.