onestart: Evaluate individual nodes for their value in invasion...

Description Usage Arguments Examples

View source: R/onestart.R

Description

For a given introduction node (only one at this point), yields two outputs for one realization. outmat has rows=time steps, columns = nodes, and entries = invasion status for each node at each time step (1 = invaded, 0 = not invaded). sampnodes has rows = nodes, first column = time step at which invasion is detected at a node (Inf if node is never reached), second column = the number of nodes invaded at the time of detection (the total number that are ever invaded if the node is never reached), third column = the number of nodes not invaded at the time of detection.

Usage

1
onestart(adjmat, start.choice, stoch)

Arguments

adjmat

adjacency matrix to be evaluated; if stoch=T, the entries are the probabilities that a link exists in any given realization

start.choice

number (ID) of node where invasion starts

stoch

logical var indicating whether adjacency matrix entries are fixed or probabilities (default is T)

Examples

1
2
3
4
Amat <- matrix(c(1,0,0,0,1,1,0,0,0,1,1,0,1,1,1,1),nrow=4,ncol=4)
onestart(adjmat=Amat, start.choice=2, stoch=F) 
sAmat <- Amat * 0.7 # each potential link has probability 0.7 of existing in one realization
onestart(adjmat=sAmat, start.choice=2, stoch=T) 

GarrettLab/INApreliminary documentation built on June 7, 2021, 10:59 a.m.