-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
2,292 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
## Copyright 2013-2019 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) | ||
|
||
## Load data | ||
data(transfers) | ||
|
||
## Perform contact tracing | ||
contactTrace <- Trace(movements = transfers, | ||
root = 2645, | ||
tEnd = "2005-10-31", | ||
days = 90) | ||
|
||
## Generate an html report showing details of the contact tracing for | ||
## root 2646. | ||
## Creates the file 2645.html in the temporary directory. | ||
Report(contactTrace, dir = tempdir()) | ||
|
||
## Drop line with version and time-stamp | ||
lines <- readLines(file.path(tempdir(), "2645.html")) | ||
lines[c(-9, -1948)] | ||
|
||
## It's possible to generate reports for a list of ContactTrace | ||
## objects. Perform contact tracing for two of the included herds | ||
root <- 1:2 | ||
|
||
## Perform contact tracing | ||
contactTrace <- Trace(movements = transfers, | ||
root = root, | ||
tEnd = "2005-10-31", | ||
days = 90) | ||
|
||
## Generate reports Creates the files 1.html, 2645.html in the | ||
## temporary directory | ||
Report(contactTrace, dir = tempdir()) | ||
|
||
lines <- readLines(file.path(tempdir(), "1.html")) | ||
lines[c(-9, -97)] |
Oops, something went wrong.
6fa653d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R/network-summary.R:262:1: style: functions should have cyclomatic complexity of less than 15, this has 38.
R/report.R:63:1: style: Lines should not be more than 80 characters.
R/report.R:151:1: style: Lines should not be more than 80 characters.
R/report.R:288:1: style: Lines should not be more than 80 characters.
R/report.R:373:42: style: Put spaces around all infix operators.
R/shortest-paths.R:169:1: style: functions should have cyclomatic complexity of less than 15, this has 41.
R/trace.R:161:1: style: functions should have cyclomatic complexity of less than 15, this has 56.
R/tree.R:135:1: style: functions should have cyclomatic complexity of less than 15, this has 48.