get_slice_edgelist: Filter edgelist for a time slice

Description Usage Arguments Value Examples

View source: R/temporal_nets.R

Description

Filter edgelist for a time slice

Usage

1
2
3
4
5
6
7
8
9
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

1
2
3
4
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)

gi0na/adjConvertR documentation built on Jan. 7, 2022, 4:48 a.m.