R Under development (unstable) (2024-10-01 r87205 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## Copyright 2013-2020 Stefan Widgren and Maria Noremark, > ## National Veterinary Institute, Sweden > ## > ## Licensed under the EUPL, Version 1.1 or - as soon they > ## will be approved by the European Commission - subsequent > ## versions of the EUPL (the "Licence"); > ## You may not use this work except in compliance with the > ## Licence. > ## You may obtain a copy of the Licence at: > ## > ## http://ec.europa.eu/idabc/eupl > ## > ## Unless required by applicable law or agreed to in > ## writing, software distributed under the Licence is > ## distributed on an "AS IS" basis, > ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either > ## express or implied. > ## See the Licence for the specific language governing > ## permissions and limitations under the Licence. > > library(EpiContactTrace) > data(transfers) > > ## > ## Check NetworkSummary > ## > > ## > ## Case 1 > ## > load(file = system.file("extdata", "ns.rda", package = "EpiContactTrace")) > root <- sort(unique(c(transfers$source, transfers$destination))) > result <- NetworkSummary(transfers, root = root, tEnd = "2005-10-31", days = 90) > stopifnot(identical(result, ns)) > > ## > ## Case 2 > ## > ns <- NetworkSummary(transfers, root = 584, tEnd = "2005-10-31", days = 91) > ns.trace <- NetworkSummary(Trace(transfers, + root = 584, + tEnd = "2005-10-31", + days = 91)) > stopifnot(identical(ns, ns.trace)) > > ## > ## Case 3 > ## > root <- c(2645, 2838) > tEnd <- "2005-10-31" > days <- 90 > contactTrace <- Trace(transfers, root, tEnd, days) > NetworkSummary(contactTrace) root inBegin inEnd inDays outBegin outEnd outDays inDegree 2645 2645 2005-08-02 2005-10-31 90 2005-08-02 2005-10-31 90 6 2838 2838 2005-08-02 2005-10-31 90 2005-08-02 2005-10-31 90 1 outDegree ingoingContactChain outgoingContactChain 2645 8 12 24 2838 1 1 3 > NetworkStructure(contactTrace) root inBegin inEnd outBegin outEnd direction source 1 2645 2005-08-02 2005-10-31 in 2019 2 2645 2005-08-02 2005-10-31 in 2036 3 2645 2005-08-02 2005-10-31 in 2357 4 2645 2005-08-02 2005-10-31 in 2846 5 2645 2005-08-02 2005-10-31 in 2847 6 2645 2005-08-02 2005-10-31 in 2852 7 2645 2005-08-02 2005-10-31 in 2825 8 2645 2005-08-02 2005-10-31 in 2823 9 2645 2005-08-02 2005-10-31 in 2839 10 2645 2005-08-02 2005-10-31 in 1375 11 2645 2005-08-02 2005-10-31 in 2357 12 2645 2005-08-02 2005-10-31 in 5615 13 2645 2005-08-02 2005-10-31 in 2890 14 2645 2005-08-02 2005-10-31 out 2645 15 2645 2005-08-02 2005-10-31 out 2645 16 2645 2005-08-02 2005-10-31 out 2645 17 2645 2005-08-02 2005-10-31 out 2821 18 2645 2005-08-02 2005-10-31 out 2821 19 2645 2005-08-02 2005-10-31 out 2645 20 2645 2005-08-02 2005-10-31 out 2825 21 2645 2005-08-02 2005-10-31 out 2825 22 2645 2005-08-02 2005-10-31 out 2825 23 2645 2005-08-02 2005-10-31 out 444 24 2645 2005-08-02 2005-10-31 out 4422 25 2645 2005-08-02 2005-10-31 out 4422 26 2645 2005-08-02 2005-10-31 out 4422 27 2645 2005-08-02 2005-10-31 out 1323 28 2645 2005-08-02 2005-10-31 out 1323 29 2645 2005-08-02 2005-10-31 out 1323 30 2645 2005-08-02 2005-10-31 out 1323 31 2645 2005-08-02 2005-10-31 out 1323 32 2645 2005-08-02 2005-10-31 out 4422 33 2645 2005-08-02 2005-10-31 out 2645 34 2645 2005-08-02 2005-10-31 out 2839 35 2645 2005-08-02 2005-10-31 out 2825 36 2645 2005-08-02 2005-10-31 out 2825 37 2645 2005-08-02 2005-10-31 out 2825 38 2645 2005-08-02 2005-10-31 out 444 39 2645 2005-08-02 2005-10-31 out 4422 40 2645 2005-08-02 2005-10-31 out 4422 41 2645 2005-08-02 2005-10-31 out 4422 42 2645 2005-08-02 2005-10-31 out 1323 43 2645 2005-08-02 2005-10-31 out 1323 44 2645 2005-08-02 2005-10-31 out 1323 45 2645 2005-08-02 2005-10-31 out 1323 46 2645 2005-08-02 2005-10-31 out 1323 47 2645 2005-08-02 2005-10-31 out 4422 48 2645 2005-08-02 2005-10-31 out 2645 49 2645 2005-08-02 2005-10-31 out 585 50 2645 2005-08-02 2005-10-31 out 264 51 2645 2005-08-02 2005-10-31 out 2645 52 2645 2005-08-02 2005-10-31 out 2645 53 2838 2005-08-02 2005-10-31 in 446 54 2838 2005-08-02 2005-10-31 out 2838 55 2838 2005-08-02 2005-10-31 out 2821 56 2838 2005-08-02 2005-10-31 out 2821 destination distance 1 2645 1 2 2645 1 3 2645 1 4 2645 1 5 2645 1 6 2645 1 7 2852 2 8 2825 3 9 2825 3 10 2839 4 11 2839 4 12 2839 4 13 2825 3 14 10644 1 15 10697 1 16 2821 1 17 2820 2 18 2880 2 19 2825 1 20 2823 2 21 2852 2 22 444 2 23 4422 3 24 10071 4 25 10072 4 26 1323 4 27 10071 5 28 10195 5 29 10196 5 30 3354 5 31 8750 5 32 3362 4 33 2839 1 34 2825 2 35 2823 3 36 2852 3 37 444 3 38 4422 4 39 10071 5 40 10072 5 41 1323 5 42 10071 6 43 10195 6 44 10196 6 45 3354 6 46 8750 6 47 3362 5 48 585 1 49 264 2 50 584 3 51 9789 1 52 9966 1 53 2838 1 54 2821 1 55 2820 2 56 2880 2 > > proc.time() user system elapsed 3.42 0.25 3.64