graph.from.spells: Create an igraph object from position spells

View source: R/period.R

graph.from.spellsR Documentation

Create an igraph object from position spells

Description

Makes a graph from a den object with time spells e.g. a row looks like this; NAME = Sam Samsen, AFFILIATION = Samson affiliates, PERSON_START = "2009-08-03", PERSON_END = "2009-12-02". PERSON_START and PERSON_END has to be Date objects, see as.Date and lubridate.

Usage

graph.from.spells(
  den,
  diagonal = FALSE,
  minimum.duration = 1,
  reference.month = strptime("1900-01-01", format = "%Y-%m-%d")
)

Arguments

den

a den class object

diagonal

if TRUE self ties, sometimes called loops, are included

minimum.duration

the minimum edge duration in number of days

reference.month

all dates are converted to the number of months since the reference month. This is to save costly conversions between character and date formats.

Value

an igraph object


antongrau/eliter documentation built on March 2, 2024, 8:05 p.m.