Convert a data frame with one number (normally a year) into an edge list form with those whose numbers (years) have a difference lower or equal to a quantity.

mobileEdges(data, name = 1, number = 2, difference=0)

Arguments

data

a data frame with a name and a number (year).

name

Column with the names (default= first column).

number

Column with the number (year) to compare (default= second column.

difference

Minimum difference between numbers of every two pair of names to create the edge or link (default=15).

Value

A data frame in which the two first columns are source and target. The rest of the columns are sim.=(1+threshold-real difference) and dist.=(difference between numbers)

Author

Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/

Examples

# From a random incidence matrix I(25X4) data("sociologists") mobileEdges(sociologists)
#> Source Target sim. dist. #> 1 Friedrich Engels Hebert Spencer 1 0 #> 2 Emile Durkheim Gaetano Mosca 1 0 #> 3 Emile Durkheim Georg Simmel 1 0 #> 4 Gaetano Mosca Georg Simmel 1 0 #> 5 George H. Mead Werner Sombart 1 0 #> 6 Charles Cooley Max Weber 1 0 #> 7 Arnold Joseph Toynbee Pitirim Sorokin 1 0