Learn R Programming

RNewsflow (version 1.2.4)

only_first_match: Transform document network so that each document only matches the earliest dated matching document

Description

Transforms the network so that a document only has an edge to the earliest dated document it matches within the specified time window[^duplicate].

Usage

only_first_match(g)

Arguments

g

A document similarity network, as created with newsflow.compare or document.network

Value

A network/graph in the igraph class

Details

If there are multiple earliest dated documents (that is, having the same publication date) then edges to all earliest dated documents are kept.

Examples

Run this code
# NOT RUN {
data(docnet)

subcomp1 = igraph::decompose.graph(docnet)[[2]]
subcomp2 = only_first_match(subcomp1)

igraph::get.data.frame(subcomp1)
igraph::get.data.frame(subcomp2)

graphics::par(mfrow=c(2,1))
document_network_plot(subcomp1, main='All matches')
document_network_plot(subcomp2, main='Only first match')
graphics::par(mfrow=c(1,1))
# }

Run the code above in your browser using DataLab