SCM

SCM Repository

[tm] Annotation of /trunk/tm/R/distmeasure.R
ViewVC logotype

Annotation of /trunk/tm/R/distmeasure.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 693 - (view) (download)

1 : feinerer 52 # Author: Ingo Feinerer
2 :    
3 : feinerer 64 setGeneric("dissimilarity", function(x, y = NULL, method) standardGeneric("dissimilarity"))
4 : feinerer 53 setMethod("dissimilarity",
5 :     signature(x = "TermDocMatrix", y = "ANY", method = "character"),
6 : feinerer 63 function(x, y = NULL, method) {
7 :     # Until factored out in a seperate package
8 :     # use the \code{dists} function from the \pkg{cba} package
9 :     dists(x, y, method)
10 : feinerer 53 })
11 :     setMethod("dissimilarity",
12 : feinerer 64 signature(x = "TextDocument", y = "TextDocument", method = "character"),
13 :     function(x, y = NULL, method) {
14 : feinerer 53 tdm <- TermDocMatrix(as(list(x,y), "TextDocCol"))
15 :     dissim <- dissimilarity(tdm, method = method)
16 :     return(dissim)
17 :     })

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge