biblionetwork 0.2.0: more measures, less memory
Draft, to publish once the CRAN acceptance email has arrived. The figure is made by make_figure.R (same folder).
A few years after the first release, a new version of biblionetwork is on its way to CRAN. The general purpose of the package is to build the edges of bibliometric networks (bibliographic coupling (Kessler 1963), co-citation (Small 1973), co-authorship) from a simple table of documents and the references they cite (as extracted from Scopus, Web of Science or the open OpenAlex database), quickly, even on big corpora. You then plot or analyse the network with your favourite tool (igraph, tidygraph, or networkflow, a companion package developed with Thomas Delcey and Alexandre Truc).
install.packages("biblionetwork")This version is a big one. Here is what changes and, more importantly, what it lets you do.
One function, several ways of measuring “similar”
Two articles citing many of the same references are “coupled”. But how strongly? Counting shared references is the simplest answer, yet a long bibliography mechanically shares more with everything. The literature has proposed several ways of correcting for this, and they do not behave identically.
biblio_coupling() is now the general function, with a method argument:
biblio_coupling(Ref_stagflation,
source = "Citing_ItemID_Ref",
ref = "ItemID_Ref",
method = "similarity")The available methods are the angle (cosine) of Sen and Gan (1983), the coupling strength, an idf-weighted similarity (which gives less weight to references that everybody cites), the Jaccard index, and the formula of Vladutz and Cook (1984). Shen et al. (2019) review and refine several of these measures, and I followed their formulas. The former biblio_coupling() lives on under the name coupling_angle(), and gives the same results.
Does the choice of measure matter? Now you can check
I wanted to stop choosing a measure by habit. So the package now includes small tools to compute several measures at once and compare them: how different are the distributions of weights, do two measures rank the strongest links in the same way, which pairs of documents are judged very close by one measure and unrelated by another.
weights <- compute_couplings(Ref_stagflation,
source = "Citing_ItemID_Ref",
ref = "ItemID_Ref")
plot_weights(weights)
If you are doing a bibliometric analysis for a paper, this is the kind of robustness check that a referee may ask for, and which now takes a few lines. The comparison article on the package website walks through it on the stagflation corpus imported with the package.
Faster, and less hungry for memory
Bibliographic coupling has a nasty property: a reference cited by thousands of documents creates millions of pairs. A colleague’s project showed that the old version could run out of memory on such corpora. The computation now relies on sparse matrices, and the package is noticeably faster and lighter. It is still not magic on enormous, very popular references, and I am working on further safeguards, but it is a clear improvement for large Scopus, OpenAlex or Web of Science extractions.
Beyond documents: entities and other networks
entity_network() (replacing coupling_entity(), now deprecated) aggregates the measures to a higher level: authors, journals, institutions, countries. It works for coupling and for co-citation networks. And the logic is not specific to citations: any table of “things that contain other things” (like social media networks) can be projected this way.
Bugs fixed
Writing a test suite for the package (there was none) turned up real bugs. The most important one: coupling_similarity() was not computing the measure it advertised. Its weights were wrong, and are now checked against the worked example of the original paper. The counts in coupling_strength() were also slightly off (a couple of percent on average on my example data). Some functions crashed when no pair of documents was linked: they now return an empty table and a warning that tells you why.
coupling_descriptive(), finally, implements the measure of Liu (2017), which also links documents citing different but related references, through the words of their titles.
To go further
Everything is documented, with worked examples and formulas, on the package website. Bug reports and ideas are welcome on GitHub.