calculateSimilarity {maDB} | R Documentation |
calculateSimilarity
calculates the similarity (distance) between the submitted numeric vector and all rows respectively columns of a numerical matrix using the specified similarity (distance) measurement method.
calculateSimilarity(vector,matrix,orientation="h",distance.fun=distance.euclidian,include.values=FALSE)
vector |
The numerical vector for which the similarities should be calculated. |
matrix |
Numerical matrix. Similarities are calculated for the input vector (vector parameter) with all rows (or columns, depending on the orientation parameter) of this matrix. |
orientation |
If the vector should be compared with the rows ("h" ) or columns ("v" ) of the matrix. |
distance.fun |
Function to calculate the similarity. |
include.values |
Include input values in the result. If FALSE only a vector with the distances will be returned. |
This function is a simple and quick way to calculate similarities of a numerical vector and the columns (or rows) of a numerical matrix. calculateSimilarity
can be used for example to search for genes with a common (similar) expression or regulation pattern than a input gene.
Johannes Rainer
distance.pearson
distance.euclidian
distance.spearman
dbSearchSimilarPattern
In <- runif(5) Testset <- rbind(a=runif(5,min=-1,max=2),b=runif(5,min=0,max=2),c=runif(5)) In Testset calculateSimilarity(vector=In,matrix=Testset,orientation="h")