DatastreamPermSoc.Rd
Creates randomised social networks for each network window using datastream permutations with user-defined restrictions (to constrain swaps according to temporal or spatial windows)
DatastreamPermSoc( data, intwindow, mindate, maxdate, netwindow, overlap, spacewindow, same.time, time.restrict, same.spat, spat.restrict, n.swaps, n.rand, burnin, n.burnin, iter, buffer = 0 )
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 |
mindate | The start date (format = |
maxdate | The end date (format = |
netwindow | The period of time (in months) over which each network is built(i.e. |
overlap | The amount of overlap between networks in months (i.e. |
spacewindow | The maximum distance between locations that can be classed as a co-capture (calculated using the coordinate system provided in the input data). Best used when multiple capture locations occur very close together |
same.time | (TRUE/FALSE) Whether swaps should be restricted to only occur betwen individuals trapped on the same date or not |
time.restrict | Provided as a number of months. Imposes time restrictions on when swaps can take place so that individuals can only be swapped with those a fixed time before or after being captured |
same.spat | (TRUE/FALSE) Whether swaps should be restricted to only occur between individuals trapped at the same location |
spat.restrict | Provided on the same scale as the coordinates in the input dataset. Imposes space restrictions on when swaps can take place so that individuals can only be swapped with those captued within a fixed distance |
n.swaps | The number of swaps between each random network being extracted (e.g. |
n.rand | The number of randomised networks to be generated |
burnin | (TRUE/FALSE) Whether burnin is required |
n.burnin | The number of swaps to discard as burn-in before the first random network is created. The total number of swaps conducted is thus n.burnin+n.swaps*n.rand |
iter | (TRUE/FALSE) Whether iterative randomisations are being used. If TRUE then D.rand is also returned |
buffer | The number of days around a capture event that an individual can't be swapped into. Defaults to zero. This exists for when trapping schedules would prevent an individual trapped on one day being trapped on adjacent days |
If iter=TRUE
then a list of length 3 with elements corresponding to:
The randomised dataset (for feeding back into the next permutation)
Randomised adjacency matrix list: a list of with the same number of elements at the number of network windows, with each element containing an array of the randomised adjacency matrices
A matrix identifying whether an individual was present in each network window.
If iter=FALSE
then a list of length 2 with elements corresponding to:
Randomised adjacency matrix list: a list of with the same number of elements at the number of network windows, with each element containing an array of the randomised adjacency matrices
A matrix identifying whether an individual was present in each network window. The edge list is not provided due to to the memory that providing this and the list of matrix arrays would require.
if (FALSE) { # load in data data(cmrData) # set parameters mindate<-"2010-01-01" maxdate<-"2015-01-01" intwindow<-60 netwindow<-12 overlap<-0 spacewindow<-0 # create network netdat<-DynamicNetCreate(data=cmrData, intwindow=intwindow, mindate=mindate, maxdate=maxdate, netwindow=netwindow, overlap=overlap, spacewindow=spacewindow) same.time=FALSE time.restrict=6 same.spat=FALSE spat.restrict="n" n.swaps=10 n.rand=100 n.burnin=100 Rs <- DatastreamPermSoc(data=cmrData, intwindow, mindate, maxdate, netwindow, overlap, spacewindow, same.time, time.restrict, same.spat, spat.restrict, n.swaps, n.rand, burnin=TRUE, n.burnin, iter=FALSE, buffer=0) }