View source: R/entity_network.R
| entity_network | R Documentation |
Builds the edges of a coupling (or co-citation) network whose nodes are
not documents but entities that aggregate documents: authors, journals,
institutions, countries... It is not a new measure of proximity: it takes
the measures of biblio_coupling() (or of biblio_cocitation()) and
computes them for entities instead of documents. Since an entity
publishes several documents, it can cite the same reference several
times, and the function takes this into account: citing a reference ten
times is more significant than citing it once. The counts are combined
with the minimum rule of \insertCitezhao2008b;textualbiblionetwork.
entity_network(
dt,
source,
ref,
entity,
network = c("coupling", "cocitation"),
method = c("angle", "strength", "similarity", "jaccard", "vladutz"),
weight_threshold = 1,
output_in_character = FALSE
)
dt |
A data frame or a |
source |
Character scalar. The column of the citing documents.
Needed to count the documents, not to define the nodes (except for
|
ref |
Character scalar. The column of the cited references. |
entity |
Character scalar. The column of the entities that are the
nodes of the network (authors, journals, institutions...). With
|
network |
|
method |
The weighting method, one of |
weight_threshold |
Number. The minimum number of shared references for two entities to be linked (1 by default). With large entities such as journals, a higher value is advisable. |
output_in_character |
Logical. If |
Write C_{Aj} for the number of times entity A cites reference
j (the number of its documents citing j), N for the
number of citing documents in the table, f_j for the number of
documents citing j, and L(A) = \sum_j C_{Aj} for the
total number of citations made by A. Write also
m_{AB}(g) = \sum_{j} \min(C_{Aj}, C_{Bj}) \, g_j, the overlap of the
two entities, with the references weighted by g_j. According to
method, the weight of the tie between A and B is
"angle", with g_j = 1:
w_{AB} = \frac{m_{AB}(1)}{\sqrt{L(A) \, L(B)}}
"strength", with g_j = \log(N / f_j):
w_{AB} = \frac{m_{AB}(g)}{L(A) \, L(B)}
"similarity", with g_j = \log(N / f_j) and
S(A) = \sum_j C_{Aj} \log(N / f_j):
w_{AB} = \frac{m_{AB}(g)}{\sqrt{S(A) \, S(B)}}
"jaccard", with g_j = 1:
w_{AB} = \frac{m_{AB}(1)}{L(A) + L(B) - m_{AB}(1)}
which is the ratio of the sum of the minima to the sum of the maxima of the counts (the weighted Jaccard index);
"vladutz", with g_j = 1 / f_j:
w_{AB} = \frac{4 \, m_{AB}(g)}{L(A) + L(B)}
The sums run over the references cited by both entities, and L, S
over all the references of the entity. The minimum of the two counts is
the number of times the two entities cite the reference "together"
\insertCitezhao2008bbiblionetwork. The package follows the paper for
the minimum rule with the coupling angle and strength; the other methods
are the same extension, applied to the measures of
coupling_similarity(), coupling_jaccard() and coupling_vladutz()
(the similarity is still bounded by 1, since
\min(C_{Aj}, C_{Bj}) \leq \sqrt{C_{Aj} C_{Bj}} and by the
Cauchy-Schwarz inequality). With a single citation per entity and
reference, each method gives back the document-level measure. f_j
counts citing documents, not entities, so that a document with several
authors is not counted several times. References cited by a single entity
cannot create a tie and are ignored in the overlaps, but they count in
L.
Co-citation. With network = "cocitation", the roles of source and
ref are swapped, as in biblio_cocitation(): the nodes are the entities
of the cited references, and the entity column must describe ref
(the author or the journal of the cited reference). Two entities are
co-cited when documents cite references of both. The formulas above apply
with the roles exchanged: C_{Aj} is the number of references of
A cited by document j.
The weight_threshold applies to the number of references shared by two
entities (each counted once, whatever the number of times it is cited).
The table of the user is not modified, rows with a missing identifier are
dropped with a warning, and a zero-row table is returned, with a warning, if no reference
is shared (or if no pair reaches weight_threshold). The memory warning
of coupling_strength() applies.
A data.table with one row per pair of entities: from, to,
the weight, the original identifiers in Source and Target, and the
Weighting_method (the method). Each pair appears once, with Source < Target.
Coupling at the level of authors (author bibliographic coupling,
\insertCitezhao2008bbiblionetwork), journals or institutions maps
who relies on the same literature, whatever the documents they publish.
With network = "cocitation", it maps which authors, journals or
institutions are cited together, as in author co-citation analysis. It is
a way to study the structure of a discipline through its journals or its
authors, with fewer and denser nodes than the document-level network.
Because entities are aggregates of documents, check that they are not too
heterogeneous (a generalist journal citing everything is coupled with
everyone), and that the number of documents per entity is large enough to
give a stable bibliography. An article with several authors appears once
for each of its authors: the same document then contributes to several
entities.
Think of an entity (say a journal) as one big bibliography made of the
bibliographies of all its documents, in which a reference appears as many
times as the entity's documents cite it. Two journals are close when their
big bibliographies overlap. Overlap is measured reference by reference by
the smaller of the two counts: if journal A cites a reference 10 times and
journal B twice, they share it twice (B is the limit). The methods then
differ in what they do with these overlaps, as their document-level
counterparts: "angle" only counts them and normalises by the sizes of the
two big bibliographies; "strength" counts a shared rare reference more
than a shared classic; "similarity" does the same but normalises by the
"informational size" of each big bibliography, to give a cosine that
cannot exceed 1; "jaccard" compares the overlap with the union of the
two big bibliographies; "vladutz" discounts popular references steeply.
library(biblionetwork)
Ref_stagflation$Citing_ItemID_Ref <- as.character(Ref_stagflation$Citing_ItemID_Ref)
# merging the references data with the citing author information in Nodes_stagflation
entity_citations <- merge(Ref_stagflation,
Nodes_stagflation,
by.x = "Citing_ItemID_Ref",
by.y = "ItemID_Ref")
entity_network(entity_citations,
source = "Citing_ItemID_Ref",
ref = "ItemID_Ref",
entity = "Author.y",
method = "angle")
# The same entities, linked when the documents of one cite the references of the other
# (nodes: the journals of the cited references, a column of Ref_stagflation)
head(entity_network(Ref_stagflation, source = "Citing_ItemID_Ref", ref = "ItemID_Ref",
entity = "Journal", network = "cocitation", weight_threshold = 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.