Parallel function to find outgoing and ingoing contact chain elements.
findContactChain(
Data,
from,
to,
Time,
selected.nodes,
type = "size",
numberOfcores = NULL
)setting type = 'size', it returns a data.frame with ingoing
and outgoing contact chains size, add 1 to include the selected.nodes.
Setting type = 'chain', it returns a list with the data
frame and elements of ingoing and outgoing chains.
data.frame with network information: node ID, origin
node, destination node, and the time in which the link was established.
character, variable name (column name) for origin node.
character, variable name (column name) for destination node.
character, variable name (column name) for the time
in which the link was established between two nodes.
vector, the function will find the contact
chain of the nodes present in the selected.nodes vector.
character, of returned result. type = 'size' (default),
will return the size of 'outgoing' and 'ingoing' contact chains.
Type = 'chain' will return also the nodes in each chain (might be slow
for big data sets).
integer, number of cores used to calculate
the contact chain (default is NULL, that will lead the algorithm to
use the max number of cores).
This is a function that find elements of a contact chain from a dynamic network.
[1] C Dube, C Ribble, D Kelton, et al. Comparing network analysis measures to determine potential epidemic size of highly contagious exotic diseases in fragmented monthly networks of dairy cattle movements in Ontario, Canada. In: Transboundary and emerging diseases 55.9-10 (Dec. 2008), pp. 382-392.
[2] C Dube, C Ribble, D Kelton, et al. A review of network analysis terminology and its application to foot-and-mouth disease modeling and policy development. In: Transboundary and emerging diseases 56.3 (Apr. 2009), pp. 73-85.
[3] Fernando S. Marques, Jose H. H. Grisi-Filho, Marcos Amaku et al. hybridModels: An R Package for the Stochastic Simulation of Disease Spreading in Dynamic Network. In: Jounal of Statistical Software Volume 94, Issue 6 <doi:10.18637/jss.v094.i06>.
[4] Jenny Frossling, Anna Ohlson, Camilla Bjorkman, et al. Application of network analysis parameters in risk-based surveillance - Examples based on cattle trade data and bovine infections in Sweden. In: Preventive veterinary medicine 105.3 (July 2012), pp. 202-208. <doi:10.1016/j.prevetmed.2011.12.011>.
[5] K Buttner, J Krieter, and I Traulsen. Characterization of Contact Structures for the Spread of Infectious Diseases in a Pork Supply Chain in Northern Germany by Dynamic Network Analysis of Yearly and Monthly Networks. In: Transboundary and emerging diseases 2000 (May 2013), pp. 1-12.
[6] Maria Noremark, Nina Ha kansson, Susanna Sternberg Lewerin, et al. Network analysis of cattle and pig movements in Sweden: measures relevant for disease control and risk based surveillance. In: Preventive veterinary medicine 99.2-4 (2011), pp. 78-90. <doi:10.1016/j.prevetmed.2010.12.009>.
# Loading data
data(networkSample) # help("networkSample"), for more info.
# contact chain function
selected.nodes <- c(37501, 36811, 36812)
contact.chain <- findContactChain(Data = networkSample, from = 'originID',
to = 'destinationID', Time = 'Day', selected.nodes,
type = 'chain', numberOfcores = 2)
Run the code above in your browser using DataLab