Description Usage Arguments Value Examples
Generate summaries of individual vertices' dynamic community membership over time.
1 | ind_membership_df(track = NULL, dcmembership = NULL)
|
track |
A MajorTrack object as produced by |
dcmembership |
A list of dynamic community membership as produced by
|
A list consisting of two objects, each showing individual dynamic community membership in a different way.
The first object 'memdf1' is a dataframe giving timestep, individual ID and dynamic community membership as 3 columns. This is useful for computation.
The second object 'memdf2' is a matrix with a row for each individual and a column for each timestep. This is an easily readable way of looking at how an individual's membership changes over time.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | data(allnets)
#detect each networks communities
coms=lapply(allnets,function(x){
igraph::cluster_louvain(x)
})
track = do_track(allnets, coms, history=1)
indmembership=ind_membership_df(track)
#use a dummy variable to look at how many IDs are in each combination of timestep and groupsize
groupsizes=aggregate(rep(1,nrow(indmembership$memdf1))~
group+timestep,FUN=sum,data=indmembership$memdf1,drop=FALSE)
names(groupsizes)[3]="groupsize"
groupsizes$groupsize[is.na(groupsizes$groupsize)]=0
groupsizes
#matrix of individual memberships
head(indmembership$memdf2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.