Description Usage Arguments Value Examples
This function collapses/sums the individual matrices from different feature columns together.
Right now, the weights are not actually implemented (multiplying each matrix by 1 minus its weight did not give distances that clearly stratified between true and false patient matches.)
The matrices are simply summed together and then divided by the total number of matrices fed in to provide a single output distance matrix, where each index is on a scale of 0 to 1, with 0 being a perfect match (zero distance between the two rows.)
1 | collapseDistMatrices(distMatrixList, weightVector = NULL, NAweight = 0.5)
|
distMatrixList |
list of distances matrices and a vector of corresponding weights default: all equal weights for each input matrix |
weightVector |
a vector of weights for each matrix. If |
NAweight |
a custom parameter specifying the score to be assigned for missing data. |
a single weighted distance matrix
1 2 3 4 5 | # just sum two of the same matrices:
caseIDVector <- data.frame(c("AB-10-1", "AB-10-5", "AB-10_1"))
m1 <- nameDists(caseIDVector)
m2 <- nameDists(caseIDVector)
summedDistMatrix <- collapseDistMatrices(list(m1, m2), c(0.5, 0.5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.