Last active
June 19, 2017 12:28
-
-
Save pauca/ccc129ddb309bd052056eaf376f843b2 to your computer and use it in GitHub Desktop.
binary distances R ( tanimoto)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.sequentix.de/gelquest/help/distance_measures.htm | |
bdist <- function( x, y , method ){ | |
a <- sum( x == 1 & y == 1) | |
b <- sum( x == 1 & y == 0) | |
c <- sum( x == 0 & y == 1) | |
d <- sum( x == 0 & y == 0) | |
switch(method, | |
tanimoto = (a+d)/(a+2*(b+c)+d), | |
stop("Method not implemented") | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment