View source: R/compare_weights.R
| compute_couplings | R Documentation |
Computes several measures of bibliographic coupling (or of co-citation)
on the same table of citations and returns a named list of edge tables,
ready for summarise_weights(), correlate_weights(),
overlap_top_weights(), merge_weights() and plot_weights(). The
costly step (finding all the pairs of nodes that share a reference) is
done only once, so computing the five measures costs little more than
computing one.
compute_couplings(
dt,
source,
ref,
methods = c("angle", "strength", "similarity", "jaccard", "vladutz"),
weight_threshold = 1,
network = c("coupling", "cocitation"),
title = NULL,
descriptive_args = list()
)
dt |
A data frame or a |
source |
Character scalar. The column of the citing documents: they are the nodes of the coupling network. |
ref |
Character scalar. The column of the cited references. |
methods |
Character vector, among |
weight_threshold |
Number. The minimum number of shared references for two documents to be linked (1 by default: any shared reference creates a tie). A threshold of 2 or 3 is common in large corpora, where sharing a single reference is weak evidence of proximity and produces very dense networks. It applies to the number of shared references, not to the normalised weight. |
network |
|
title |
Character scalar. The column with the title of the cited
references, needed (only) for |
descriptive_args |
A list of further arguments for
|
The five measures that start from the shared references are computed on
the same pairs of nodes (those sharing at least weight_threshold
references), so that their weights can be compared pair by pair.
"descriptive" (the DescriptiveBC measure of
\insertCiteliu2017biblionetwork) is different in two ways. It
couples documents that cite different but related references, so its
pairs are not the same ones: any pair of documents with similar titles of
references is concerned, whatever the number of shared references (the
weight_threshold does not apply to it). And its cost grows with the
square of the number of documents: the function informs you when you
ask for it, and you should give targets or work on a time window for a
large corpus. merge_weights() puts the tables side by side, with NA
for the pairs a measure does not have.
A named list with one data.table per method, each with columns
Source, Target and weight. The tables of the five measures
describe the same pairs of nodes (those sharing at least
weight_threshold references, or co-cited at least weight_threshold
times), in the same order. The table of "descriptive" has its own pairs.
The choice of a measure is a modelling choice, not a technical detail: it determines which pairs of documents look close, and thus the communities found. \insertCiteshen2019biblionetwork show on one corpus that the measures can be very close (coupling angle and similarity) or quite different (Vladutz-Cook and the others). Whether it matters for your corpus can only be checked on your corpus: compute the measures with this function, and compare the distributions and the rankings of the weights. The article comparing the measures does it on the stagflation corpus.
Other tools to compare coupling measures:
correlate_weights(),
merge_weights(),
overlap_top_weights(),
plot_weights(),
summarise_weights()
library(biblionetwork)
edges <- compute_couplings(Ref_stagflation,
source = "Citing_ItemID_Ref",
ref = "ItemID_Ref",
weight_threshold = 2)
names(edges)
summarise_weights(edges)
correlate_weights(edges)
# The titles-based measure is not computed by default; it needs the titles of the references
toy <- data.frame(
doc = c("a", "a", "b", "b"),
ref = c("r1", "r2", "r1", "r3"),
title = c("inflation expectations", "oil supply shocks",
"inflation expectations", "supply shocks prices")
)
compute_couplings(toy, "doc", "ref", methods = c("angle", "descriptive"), title = "title")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.