This function calculates coherence and dominance for two-mode networks (and attributes) extracted for each year between the given dates

twomode_2x2(node1, node2, ties, attr1, attr2, start, end)

Arguments

node1

First nodeset object (will become matrix rows)

node2

Second nodeset object (will become matrix columns)

ties

Edgelist of affiliations/memberships of first nodeset in second nodeset

attr1

Object containing information on an attribute by year, in long format

attr2

Object containing information on an attribute by year, in long format

start

Integer, for example a year like 1960

end

Integer, for example a year like 2010

Value

A data frame with two columns (Coherence and Dominance)

Details

Note that this function has defaults that make sense for use with the gnevar datasets. Please contact me if you would like to make this function more general.

See also

Examples

library(gnevar) library(wbstats) mil_data <- wb(country = unique(stat_actor$StatID), indicator = "MS.MIL.XPND.CN", startdate = 1960, enddate = 2018)
#> Warning: The following country values are not valid and are being excluded from the request: ABK,ACH,ALT,ASA,ASI,AST,AUH,AZA,BAD,BAV,BHP,BHT,BIK,BNJ,BPR,BRE,BUK,CAY,CHM,COK,CUT,DDR,DFR,DIR,DJA,DRV,DZG,EAZ,EHT,ETS,EUE,FNJ,FTO,GCL,GDR,GWA,HAN,HAW,HBG,HEJ,HSE,HSG,INO,IPH,JMK,JOD,JOH,JPR,KAF,KAS,KAT,KED,KEL,KHI,KHV,KLT,KNB,KOK,KON,KOS,KOT,KPT,KRG,KTA,KUB,LIM,LIP,LUB,LUN,MDK,MEC,MIN,MOD,MOS,MPR,NAG,NAS,NIU,OFS,OLD,OVB,OYO,PAH,PES,PMA,PUN,QUA,RVN,SAL,SAW,SAX,SEG,SEL,SHO,SIA,SIC,SID,SIK,SIR,SOK,SOT,SUL,SXA,SXG,SXW,TBT,TER,TEX,TKL,TOK,TRA,TUS,UPC,UPR,VAT,WAD,WRT,YAR,YEK,YPR,YUG,ZAN,ZIN,ZUL
ally_secs <- structure((!is.na(ally_agree$Secretariat))*1, names=as.character(ally_agree$AtopID)) ally_topo <- twomode_2x2(stat_actor, ally_agree, ally_membs, mil_data, ally_secs, 1960, 2018)
#> Error in colSums(gnevar::snap(node1, node2, ties, time = t)): 'x' must be an array of at least two dimensions
plot_2x2(ally_topo)
#> Error in ggplot(dat, aes_string(x = names(dat)[1], y = names(dat)[2])): object 'ally_topo' not found