Creates dynamic social networks from capture-mark-recapture datasets using information on co-capture

DynamicNetCreate(
  data,
  intwindow,
  mindate,
  maxdate,
  netwindow,
  overlap,
  spacewindow,
  index = FALSE
)

Arguments

data

A 5 column dataframe with columns for the ID of the captured individual, the location of its capture (a name or number), the x coordinate of its capture location, the y coordinate of the capture location, and the date of capture

intwindow

The maximum period of time (in days) between two co-captures (i.e. if intwindow = 10 then two individuals captured 10 days apart could be considered co-captured but two individuals captured 11 days apart couldn't)

mindate

The start date (format = "YYYY-MM-DD") of the study (i.e. when you want to build networks from)

maxdate

The end date (format = "YYYY-MM-DD") of the study (i.e. when you want to build networks until). Please provide as the day after the last day of the study.

netwindow

The period of time over which each network is built in months (i.e. netwindow=12 would correspond to yearly networks)

overlap

The amount of overlap between netwindows in months (i.e. overlap = 2 would result in a second network window starting 2 months before the end of the first). When overlap=0, there is no overlap between successive network windows

spacewindow

The maximum distance between locations that can be classed as a co-capture (calculated using the coordinate system provided in in the input data). Best used when multiple capture locations occur very close together

index

Defaults to FALSE. If FALSE edges are weighted by the number of co-captures. If TRUE then edges are weighted by the number by an association index (no. co-captures / (total captures of A + total captures of B - no. of captures))

Value

A list of length 3 containing:

  1. The edgelist for the social network in each of the netwindows as an array

  2. The adjacency matrix for the social network in each of the netwindows as an array

  3. A matrix indicating which individuals occurred in each netwindow

Details

The time period for each network, together with the temporal and spatial restrictions on the co-capture window can be defined by the user

Examples

if (FALSE) { # load example data data(cmrData) # set parameters for network creation mindate<-"2010-01-01" maxdate<-"2015-01-01" intwindow<-60 netwindow<-12 overlap<-0 spacewindow<-0 # create dynamic network netdat<-DynamicNetCreate(data=cmrData, intwindow=intwindow, mindate=mindate, maxdate=maxdate, netwindow=netwindow, overlap=overlap, spacewindow=spacewindow, index=FALSE) }