community_residuals: Calculate residuals for communities in a network

Description Usage Arguments See Also Examples

View source: R/residuals.R

Description

Compute the residual sum of squares for each journal in a network, given a community structure.

Usage

1
community_residuals(citations, communities, self = TRUE)

Arguments

citations

a matrix of citations (from columns to rows) or an igraph object

communities

A membership vector or igraph::communities object

self

logical. Include self-citations? If FALSE, they will not be counted.

See Also

Other functions for residual analysis of communities: fitted_citations, profile_residuals

Examples

1
2
3
4
5
distances <- as.dist(1 - cor(citations + t(citations) - diag(diag(citations))))
clusters <- cutree(hclust(distances), h = 0.6)
cr <- community_residuals(citations, clusters)
plot(colSums(citations), cr, xlab = 'Journal size', ylab = 'Journal RSS', type = 'n')
text(colSums(citations), cr, labels = colnames(citations))

Selbosh/scrooge documentation built on May 5, 2019, 8 p.m.