Filter edgelist for a time slice

get_slice_edgelist(
  edge.list,
  select_cols = NULL,
  start_time,
  end_time = NULL,
  duration = NULL,
  index = FALSE,
  as_date = NULL
)

Arguments

edge.list

the edgelist from which to compute the time slices

select_cols

optional vector of 3 (2 for multi-graphs) elements specifying which columns are the source,target, and attributes from which building the graph. Otherwise Column 1 is assumed to be the source, column 2 the target, column 3 the attribute. In the case of multi-graphs, the third element is not needed and the number of edges between each pair of vertices is computed according to 'aggr_expression'.

start_time

the timestamp a which start the timewindow slice. It can be an integer defining either the index of the start point or the unit of time at which to cut, or a datestring string.

end_time

(optional) the timestamp a which to end the timewindow slice. It can be an integer defining either the index of the end point or the unit of time at which to cut, or a datestring string.

duration

(optional) the duration of the timewindow. If `end_time` is not provided it defines how long after `start_time` the window should be cut.

index

boolean, set to TRUE if start_time and end_time are supplied as indices. Defaults to FALSE.

as_date

(optional) boolean, are the timestamps supplied as datestrings?

Value

a tibble with the edgelist cut such that timestamps are between `start_time` and `end_time`

Examples

el <- data.frame(from= c('a','b','b','c','d','d'), to = c('b','c','d','a','b','a'), t = 1:6 ) slice <- get_slice_edgelist(el, select_cols = 1:3, start_time = 2, duration = 3)