SCM

SCM Repository

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

View of /trunk/tm/R/distmeasure.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 720 - (download) (annotate)
Tue Mar 20 10:43:11 2007 UTC (12 years, 5 months ago) by feinerer
File size: 756 byte(s)
Some bug fixes.
# Author: Ingo Feinerer

setGeneric("dissimilarity", function(x, y = NULL, method) standardGeneric("dissimilarity"))
setMethod("dissimilarity",
          signature(x = "TermDocMatrix", y = "ANY", method = "character"),
          function(x, y = NULL, method) {
              # Until factored out in a seperate package
              # use the \code{dists} function from the \pkg{cba} package
              dists(as(Data(x), "matrix"), y, method)
          })
setMethod("dissimilarity",
          signature(x = "TextDocument", y = "TextDocument", method = "character"),
          function(x, y = NULL, method) {
              tdm <- TermDocMatrix(c(x, y))
              dissim <- dissimilarity(tdm, method = method)
              return(dissim)
          })

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