SCM

SCM Repository

[tm] Diff of /trunk/R/textmin/R/distmeasure.R
ViewVC logotype

Diff of /trunk/R/textmin/R/distmeasure.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 63, Thu Oct 26 14:59:09 2006 UTC revision 64, Sun Oct 29 14:29:43 2006 UTC
# Line 1  Line 1 
1  # Author: Ingo Feinerer  # Author: Ingo Feinerer
2    
3  setGeneric("dissimilarity", function(x, y, method) standardGeneric("dissimilarity"))  setGeneric("dissimilarity", function(x, y = NULL, method) standardGeneric("dissimilarity"))
4  setMethod("dissimilarity",  setMethod("dissimilarity",
5            signature(x = "TermDocMatrix", y = "ANY", method = "character"),            signature(x = "TermDocMatrix", y = "ANY", method = "character"),
6            function(x, y = NULL, method) {            function(x, y = NULL, method) {
# Line 9  Line 9 
9                dists(x, y, method)                dists(x, y, method)
10            })            })
11  setMethod("dissimilarity",  setMethod("dissimilarity",
12            c("TextDocument", "TextDocument", "character"),            signature(x = "TextDocument", y = "TextDocument", method = "character"),
13            function(x, y, method) {            function(x, y = NULL, method) {
14                tdm <- TermDocMatrix(as(list(x,y), "TextDocCol"))                tdm <- TermDocMatrix(as(list(x,y), "TextDocCol"))
15                dissim <- dissimilarity(tdm, method = method)                dissim <- dissimilarity(tdm, method = method)
16                class(dissim) <- "dist"                #class(dissim) <- "dist"
17                return(dissim)                return(dissim)
18            })            })

Legend:
Removed from v.63  
changed lines
  Added in v.64

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