MatchSigs2Directions: Bidirectional closest similarities between two sets of...

Description Usage Arguments Value Examples

View source: R/match.sigs.R

Description

Bidirectional closest similarities between two sets of signatures.

Usage

1
MatchSigs2Directions(sigs1, sigs2)

Arguments

sigs1

Matrix of signatures; colnames are used as signature identifiers, and the colnames in sigs1 should be distinguishable from those in sigs2.

sigs2

Matrix of signatures; colnames are used as signature identifiers.

Value

A list with the elements:

averCosSim: the average of the cosine similarities between each signature in sigs1 and its closest match in sigs2 and the closest match between each signature in sigs2 and its closest match in sigs1.

match1: a data frame with rownames being signature identifiers from sigs1, the signature identifier of the closest match in sigs1 in the 1st column, and the cosine similarity between them in the 2nd column.

match2: a data frame with the row names being signature identifiers from sigs2, the signature identifier of the closest match in sigs1 in the 1st column, and the cosine similarity between them in the 2nd column.

match1 and match2 might not have the same number of rows.

Examples

1
2
3
4
5
seta <- matrix(c(1, 3,   4, 1, 2, 4), ncol = 2)
setb <- matrix(c(1, 3.1, 4, 5, 1, 1, 1, 2.8, 4), ncol = 3)
colnames(seta) <- c("A.1", "A.2")
colnames(setb) <- c("B.1", "B.2", "B.3")
MatchSigs2Directions(seta, setb)

steverozen/ICAMSxtra documentation built on Feb. 9, 2022, 7:01 a.m.