Better default plotting of values traced through a two-by-two than ggplot2

plot_2x2(dat, colour = "red")

Arguments

dat

A data.frame

Value

A plot

Details

Makes for clearer communication of structure than ggplot2 defaults

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)
#> Loading required package: ggplot2
#> Error in ggplot(dat, aes_string(x = names(dat)[1], y = names(dat)[2])): object 'ally_topo' not found