sims {rscc} | R Documentation |
similarities
Description
sims
and similarities
both calculate for each pair of source code objects
the similarity coefficients and return a data frame with the coefficients in descending order.
A larger coefficient means a greater similarity.
Usage
sims(...)
similarities(
docs,
all = FALSE,
coeff = c("jaccard", "braun", "dice", "hamann", "kappa", "kulczynski", "ochiai",
"phi", "russelrao", "matching", "simpson", "sneath", "tanimoto", "yule")
)
Arguments
... |
all parameters in |
docs |
document object |
all |
logical: should the similarity coefficients computed based on all sourcecode objects or just the two considered (default: |
coeff |
character: coefficient to compute (default: |
Value
a data frame with the results
Examples
# example files are taken from https://CRAN.R-project.org/package=SimilaR
files <- list.files(system.file("examples", package="rscc"), "*.R$", full.names=TRUE)
prgs <- sourcecode(files, basename=TRUE)
docs <- documents(prgs)
similarities(docs)
# further steps
# m <- similarities(docs)
# df <- matrix2dataframe(m)
# head(df, n=20)
# browse(prgs, df, n=5)
[Package rscc version 0.2.1 Index]