sMatrix {locStra}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

Description

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

Usage

sMatrix(m, useCpp = TRUE, sparse = TRUE, Djac = FALSE, phased = FALSE)

Arguments

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 useCpp=TRUE.

sparse

Flag to switch between purpose-built dense or sparse implementations. Default is sparse=TRUE.

Djac

Flag to switch between the unweighted (Djac=TRUE) or weighted (Djac=FALSE) version. Default is Djac=FALSE.

phased

Boolean flag to indicate if the input matrix is phased. Default is phased=FALSE.

Value

The s-matrix (the weighted Jaccard matrix) of m.

References

Daniel Schlauch (2016). Implementation of the stego algorithm - Similarity Test for Estimating Genetic Outliers. https://github.com/dschlauch/stego

Examples

require(locStra)
require(Matrix)
m <- matrix(sample(0:1,15,replace=TRUE),ncol=3)
sparseM <- Matrix(m,sparse=TRUE)
print(sMatrix(sparseM))


[Package locStra version 1.9 Index]