fast_sim {imp4p}R Documentation

Function to compute similarity measures between a vector and each row of a matrix.

Description

This function allows computing either the pairwise correlation between a vector and each row of a matrix if each has at least 3 side-by-side observed values, or 1/(1+d) where d is the euclidean distance between side-by-side observed values if the vector contains less than 3 observed values. If the vector contains more than 3 observed values and a row of the matrix has less than 3 observed values, then it gives NA. It is implemented thanks to the RCpp package.

Usage

fast_sim(prot, mat)

Arguments

prot

A numeric vector containing numeric and missing values.

mat

A data matrix containing numeric and missing values.

Value

A numeric vector containing the values of the similarity measures between the prot vector and each row of the mat matrix.

Author(s)

Quentin Giai Gianetto <quentin2g@yahoo.fr>

Examples


#Simulating data
res.sim=sim.data(nb.pept=20000,nb.miss=1000);

#Fast computation of similarities
fast_sim(res.sim$dat.obs[1,],res.sim$dat.obs);


[Package imp4p version 0.7 Index]