move_events_df: Get dataframe of dynamic community changes

Description Usage Arguments Value Examples

View source: R/MTRfuncs.R

Description

Generate data frame of movement, splits, merges and remains between dynamic communities.

Usage

1
move_events_df(track, allremains = F)

Arguments

track

A MajorTrack object as produced by do_track

allremains

Boolean indicating if remain events from dynamic communities undergoing no change should be included in the dataframe. Default is false.

Value

A dataframe consisting of 6 columns. The first column "slice" indicates the timestep, starting from the second timestep.

The second column "parent" indicates which dynamic community in the previous timestep a "child" dynamic community (third column) emerged from in the current timestep. This will be NA if the vertex is involved in an immigration or emmigration event.

The fourth column "type" shows the type of event. This can be a "merge" - a dynamic community being created due to two dynamic communities joining together, a "split" - a dynamic community emerging as the result of a single dynamic community splitting up, a "move" - some nodes moving from one previously existing dynamic community to previously existing another and finally a "remain" - nodes staying in the same dynamic community as the previous timestep.

By default, remain events only appear in the table if the parent/child is also involved in some other event.

The fifth colum "moveid" provides a unique identifier for each event, combining the timestep, parent and child columns.

The sixth column "size" shows how many vertices were involved in a particular event.

Examples

1
2
3
4
5
6
7
data(allnets)
#detect each networks communities
coms=lapply(allnets,function(x){
  igraph::cluster_louvain(x)
})
track = do_track(allnets, coms, history=1)
move_events_df(track)

jevansbio/MajorTrackR documentation built on Dec. 20, 2021, 11:06 p.m.