I\'m wondering if there is a built in function in R that can find the cosine similarity (or cosine distance) between two arrays?
Currently, I implemented my own func
Taking the comment from Jonathan Chang I wrote this function to mimic dist. No extra packages to load.
cosineDist <- function(x){ as.dist(1 - x%*%t(x)/(sqrt(rowSums(x^2) %*% t(rowSums(x^2))))) }