cmr_igraph: cmr_igraph

View source: R/cmr_igraph.R

cmr_igraphR Documentation

cmr_igraph

Description

Converts CMRnet networks to lists of igraph networks

Usage

cmr_igraph(cmrnet, type = c("social", "movement", "multiplex"))

Arguments

cmrnet

A CMRnet object from DynamicNetCreate, MoveNetCreate or MultiMoveNetCreate functions

type

The type of CMRnet object. Three possible arguments: "social" (object from DynamicNetCreate), "movement" (object from MoveNetCreate) and "multiplex" (object from MultiMoveNetCreate)

Details

This function converts CMRnet objects into lists of igraph networks for onward analysis and plotting

Value

igraph networks for onward analysis. For all types of network the function returns a list of two outputs. For social and movement networks the first element is itself a list containing the igraph network corresponding to each network window. The second element of the list is the overall network calculated for all network windows combined. For multiplex movement networks the first list is more complex with an additional layer. The list of networks for different network windows is nested so that for each network window the movement network for each layer is stored separately.

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)

# convert to networks
networks<-cmr_igraph(movenetdat,type="movement")

# example with multiplex 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)

# convert to networks
networks<-cmr_igraph(multimovenetdat,type="multiplex")

## End(Not run)

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