as_igraph: as.igraph

Description Usage Arguments Value Examples

Description

Converts a data frame of similarity coefficients into a graph.

Usage

1
as_igraph(x, tol = 100 * .Machine$double.eps, tol1 = 8 * tol, ...)

Arguments

x

a similarity object

tol

numeric scalar >= 0. Smaller differences are not considered, see all.equal.numeric.

tol1

numeric scalar >= 0. isSymmetric.matrix() ‘pre-tests’ the first and last few rows for fast detection of ‘obviously’ asymmetric cases with this tolerance. Setting it to length zero will skip the pre-tests.

...

further parameters used by igraph::graph_from_adjacency_matrix

Value

an igraph object

Examples

1
2
3
4
5
6
7
8
files <- list.files(path=system.file("examples", package="rscc"), pattern="*.R$", full.names = TRUE)
prgs  <- sourcecode(files, title=basename(files))
docs  <- documents(prgs)
simm  <- similarities(docs)
# a similarity coefficients equal to zero does not create an edge!
g <- as_igraph(simm, diag=FALSE)
# thicker edges have higher similarity coefficients
plot(g, edge.width=1+3*igraph::E(g)$weight)

rscc documentation built on Jan. 20, 2022, 5:08 p.m.