install.packages('lsa',dependencies=T)
library(lsa)
m1<-c(1,2,1,0)
m2<-c(1,1,1,0)
cosine(m1,m2)
有了这个包计算相关性就简单了
http://cran.r-project.org/web/packages/lsa/index.html
problem:
http://stackoverflow.com/questions/7129303/cant-install-rjava-0-9-on-ubuntu-10-04
4 | Dah, not long after posting I found the answer here: http://realshared.com/2011/how-to-install-r-jgr-and-deducer-in-ubuntu-10-04.htm Although I already had Sun Java installed, the key was to run
|
http://www.cnblogs.com/lexus/archive/2011/12/01/2271060.html