calculateSimilarity {maDB}R Documentation

Calculate similarities (distances) between a vector and the rows (columns) of a matrix

Description

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.

Usage

calculateSimilarity(vector,matrix,orientation="h",distance.fun=distance.euclidian,include.values=FALSE)

Arguments

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.

Details

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.

Author(s)

Johannes Rainer

See Also

distance.pearson distance.euclidian distance.spearman dbSearchSimilarPattern

Examples

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")


[Package maDB version 1.14.1 Index]