cmrNodeswap: cmrNodeswap

View source: R/cmrNodeswap.R

cmrNodeswapR Documentation

cmrNodeswap

Description

Conducts node-swap randomisations for CMRnet outputs

Usage

cmrNodeswap(cmrnet, n.rand, multi = FALSE)

Arguments

cmrnet

A CMRnet object from DynamicNetCreate, MoveNetCreate or MultiMoveNetCreate

n.rand

The number of permuted matrices to be conducted by the rmperm() algorithm

multi

(TRUE/FALSE). Indicates whether the input object is a monolayer network (from DynamicNetCreate or MoveNetCreate) or multiplex network (MultiMoveNetCreate)

Details

This function conducts network permutations of CMRnet objects, acting as a wrapper for sna::rmperm()

Value

The randomised networks. If multi=FALSE then this consists of a list in which each element of the list corresponds to a particular network window and contains an array consisting of all of the randomised networks. If multi=TRUE then this consists of a nested list arrangement in which each element of the first list corresponds to a particular network window, and each element of the second list a layer of the multiplex for that network window. Each element of the second level contains an array consisting of all of the randommised versions of that layer in that network window

Examples

## Not run: 
# example without multiple layers ####

# load in data
data(cmrData)

# set parameters
mindate<-"2010-01-01"
maxdate<-"2015-01-01"
intwindow<-60
netwindow<-12
overlap<-0

# create network
movenetdat<-MoveNetCreate(data=cmrData,
intwindow=intwindow,
mindate=mindate,
maxdate=maxdate,
netwindow=netwindow,
overlap=overlap,
nextonly=TRUE)

# run permutations
A<-cmrNodeswap(movenetdat,n.rand=1000)

# example with multiple layered networks ####

# load in data
data(cmrData2)

# set parameters
mindate<-"2010-01-01"
maxdate<-"2015-01-01"
intwindow<-60
netwindow<-12
overlap<-0

# create network
multimovenetdat<-MultiMoveNetCreate(data=cmrData2,
intwindow=intwindow,
mindate=mindate,
maxdate=maxdate,
netwindow=netwindow,
overlap=overlap,
nextonly=TRUE)

# run permutations
B<-cmrNodeswap(multimovenetdat,n.rand=1000,multi=TRUE)

## End(Not run)

matthewsilk/CMRnet documentation built on Nov. 16, 2022, 10:47 p.m.