Skip to content

Commit

Permalink
code style: change to use double-quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
stewid committed Nov 2, 2019
1 parent 0a2d416 commit 6c0f0e9
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 109 deletions.
48 changes: 24 additions & 24 deletions tests/contact-chain.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ movements <- structure(list(source = 1:7, destination = c(4L, 5L, 5L,
"t"), class = "data.frame", row.names = c(NA, -7L))
ct <- Trace(movements,
root = 8L,
inBegin = as.Date('2010-08-22'),
inEnd = as.Date('2010-10-01'),
outBegin = as.Date('2010-08-01'),
outEnd = as.Date('2010-08-31'))
inBegin = as.Date("2010-08-22"),
inEnd = as.Date("2010-10-01"),
outBegin = as.Date("2010-08-01"),
outEnd = as.Date("2010-08-31"))
ct
stopifnot(identical(IngoingContactChain(ct)$ingoingContactChain, 7L))
stopifnot(identical(OutgoingContactChain(ct)$outgoingContactChain, 0L))
Expand All @@ -54,10 +54,10 @@ NA_integer_)), .Names = c("source", "destination", "t", "individual",
"n"), row.names = c(NA, -4L), class = "data.frame")
ct <- Trace(movements,
root = 4L,
inBegin = as.Date('2010-07-22'),
inEnd = as.Date('2010-08-21'),
outBegin = as.Date('2010-08-01'),
outEnd = as.Date('2010-08-31'))
inBegin = as.Date("2010-07-22"),
inEnd = as.Date("2010-08-21"),
outBegin = as.Date("2010-08-01"),
outEnd = as.Date("2010-08-31"))
ct
stopifnot(identical(IngoingContactChain(ct)$ingoingContactChain, 3L))
stopifnot(identical(OutgoingContactChain(ct)$outgoingContactChain, 0L))
Expand All @@ -73,10 +73,10 @@ c(NA_character_, NA_character_ ), n = c(NA_integer_, NA_integer_)),
= c(NA, -2L), class = "data.frame")
ct <- Trace(movements,
root = 1L,
inBegin = as.Date('2010-08-02'),
inEnd = as.Date('2010-09-01'),
outBegin = as.Date('2010-09-01'),
outEnd = as.Date('2010-10-01'))
inBegin = as.Date("2010-08-02"),
inEnd = as.Date("2010-09-01"),
outBegin = as.Date("2010-09-01"),
outEnd = as.Date("2010-10-01"))
ct
stopifnot(identical(IngoingContactChain(ct)$ingoingContactChain, 1L))
stopifnot(identical(OutgoingContactChain(ct)$outgoingContactChain, 0L))
Expand All @@ -95,10 +95,10 @@ NA_integer_)), .Names = c("source", "destination", "t", "individual",
"n"), row.names = c(NA, -7L ), class = "data.frame")
ct <- Trace(movements,
root = 1L,
inBegin = as.Date('2010-08-02'),
inEnd = as.Date('2010-09-01'),
outBegin = as.Date('2010-08-01'),
outEnd = as.Date('2010-11-09'))
inBegin = as.Date("2010-08-02"),
inEnd = as.Date("2010-09-01"),
outBegin = as.Date("2010-08-01"),
outEnd = as.Date("2010-11-09"))
ct
stopifnot(identical(IngoingContactChain(ct)$ingoingContactChain, 0L))
stopifnot(identical(OutgoingContactChain(ct)$outgoingContactChain, 7L))
Expand All @@ -114,10 +114,10 @@ c(NA_character_, NA_character_ ), n = c(NA_integer_, NA_integer_)),
= c(NA, -2L), class = "data.frame")
ct <- Trace(movements,
root = 1L,
inBegin = as.Date('2010-07-02'),
inEnd = as.Date('2010-08-01'),
outBegin = as.Date('2010-08-01'),
outEnd = as.Date('2010-08-31'))
inBegin = as.Date("2010-07-02"),
inEnd = as.Date("2010-08-01"),
outBegin = as.Date("2010-08-01"),
outEnd = as.Date("2010-08-31"))
ct
stopifnot(identical(IngoingContactChain(ct)$ingoingContactChain, 0L))
stopifnot(identical(OutgoingContactChain(ct)$outgoingContactChain, 1L))
Expand All @@ -134,10 +134,10 @@ class = "factor")), .Names = c("source", "destination", "t"), class =
"data.frame", row.names = c(NA, -7L))
ct <- Trace(movements,
root = 1L,
inBegin = as.Date('2010-10-10'),
inEnd = as.Date('2010-10-20'),
outBegin = as.Date('2010-10-10'),
outEnd = as.Date('2010-10-20'))
inBegin = as.Date("2010-10-10"),
inEnd = as.Date("2010-10-20"),
outBegin = as.Date("2010-10-10"),
outEnd = as.Date("2010-10-20"))
ct
stopifnot(identical(IngoingContactChain(ct)$ingoingContactChain, 0L))
stopifnot(identical(OutgoingContactChain(ct)$outgoingContactChain, 2L))
Expand Down
48 changes: 24 additions & 24 deletions tests/degree.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ movements <- structure(list(source = c(1L, 2L, 3L, 3L),

ct <- Trace(movements,
root = 4L,
inBegin = as.Date('2010-08-02'),
inEnd = as.Date('2010-09-01'),
outBegin = as.Date('2010-08-01'),
outEnd = as.Date('2010-08-31'))
inBegin = as.Date("2010-08-02"),
inEnd = as.Date("2010-09-01"),
outBegin = as.Date("2010-08-01"),
outEnd = as.Date("2010-08-31"))

stopifnot(identical(InDegree(ct)$inDegree, 1L))
stopifnot(identical(OutDegree(ct)$outDegree, 0L))
Expand All @@ -56,7 +56,7 @@ movements <- structure(list(source = c(1L, 2L, 3L, 3L),
.Names = c("source", "destination", "t", "individual", "n"),
row.names = c(NA, -4L), class = "data.frame")

ns <- NetworkSummary(movements, root = 4, tEnd = '2010-09-01', days = 30)
ns <- NetworkSummary(movements, root = 4, tEnd = "2010-09-01", days = 30)
stopifnot(identical(ns$inDegree, 1L))

##
Expand All @@ -70,7 +70,7 @@ movements <- structure(list(source = c(1L, 2L, 3L, 3L),
.Names = c("source", "destination", "t", "individual", "n"),
row.names = c(NA, -4L), class = "data.frame")

ns <- NetworkSummary(movements, root = 4, tEnd = '2010-08-31', days = 30)
ns <- NetworkSummary(movements, root = 4, tEnd = "2010-08-31", days = 30)
stopifnot(identical(ns$outDegree, 0L))

##
Expand All @@ -86,10 +86,10 @@ movements <- structure(list(source = c(1L, 2L, 3L, 3L),

ct <- Trace(movements,
root = 4L,
inBegin = as.Date('2010-08-27'),
inEnd = as.Date('2010-09-01'),
outBegin = as.Date('2010-08-01'),
outEnd = as.Date('2010-08-31'))
inBegin = as.Date("2010-08-27"),
inEnd = as.Date("2010-09-01"),
outBegin = as.Date("2010-08-01"),
outEnd = as.Date("2010-08-31"))

stopifnot(identical(InDegree(ct)$inDegree, 0L))
stopifnot(identical(OutDegree(ct)$outDegree, 0L))
Expand All @@ -105,7 +105,7 @@ movements <- structure(list(source = c(1L, 2L, 3L, 3L),
.Names = c("source", "destination", "t", "individual", "n"),
row.names = c(NA, -4L), class = "data.frame")

ns <- NetworkSummary(movements, root = 4, tEnd = '2010-09-01', days = 5)
ns <- NetworkSummary(movements, root = 4, tEnd = "2010-09-01", days = 5)
stopifnot(identical(ns$inDegree, 0L))

##
Expand All @@ -119,7 +119,7 @@ movements <- structure(list(source = c(1L, 2L, 3L, 3L),
.Names = c("source", "destination", "t", "individual", "n"),
row.names = c(NA, -4L), class = "data.frame")

ns <- NetworkSummary(movements, root = 4, tEnd = '2010-08-31', days = 30)
ns <- NetworkSummary(movements, root = 4, tEnd = "2010-08-31", days = 30)
stopifnot(identical(ns$outDegree, 0L))

##
Expand All @@ -135,10 +135,10 @@ movements <- structure(list(source = c("1", "1", "1"),

ct <- Trace(movements,
root = 1L,
inBegin = as.Date('2010-08-02'),
inEnd = as.Date('2010-09-01'),
outBegin = as.Date('2010-08-01'),
outEnd = as.Date('2010-08-31'))
inBegin = as.Date("2010-08-02"),
inEnd = as.Date("2010-09-01"),
outBegin = as.Date("2010-08-01"),
outEnd = as.Date("2010-08-31"))

stopifnot(identical(InDegree(ct)$inDegree, 0L))
stopifnot(identical(OutDegree(ct)$outDegree, 3L))
Expand All @@ -154,7 +154,7 @@ movements <- structure(list(source = c("1", "1", "1"),
.Names = c("source", "destination", "t", "individual", "n"),
row.names = c(NA, -3L), class = "data.frame")

ns <- NetworkSummary(movements, root = 1, tEnd = '2010-09-01', days = 30)
ns <- NetworkSummary(movements, root = 1, tEnd = "2010-09-01", days = 30)
stopifnot(identical(ns$inDegree,0L))

##
Expand All @@ -168,7 +168,7 @@ movements <- structure(list(source = c("1", "1", "1"),
.Names = c("source", "destination", "t", "individual", "n"),
row.names = c(NA, -3L), class = "data.frame")

ns <- NetworkSummary(movements, root = 1, tEnd = '2010-08-31', days = 30)
ns <- NetworkSummary(movements, root = 1, tEnd = "2010-08-31", days = 30)
stopifnot(identical(ns$outDegree, 3L))

##
Expand All @@ -184,10 +184,10 @@ movements <- structure(list(source = c("1", "1", "1"),

ct <- Trace(movements,
root = 1L,
inBegin = as.Date('2010-08-02'),
inEnd = as.Date('2010-09-01'),
outBegin = as.Date('2010-08-01'),
outEnd = as.Date('2010-08-16'))
inBegin = as.Date("2010-08-02"),
inEnd = as.Date("2010-09-01"),
outBegin = as.Date("2010-08-01"),
outEnd = as.Date("2010-08-16"))

stopifnot(identical(InDegree(ct)$inDegree, 0L))
stopifnot(identical(OutDegree(ct)$outDegree, 2L))
Expand All @@ -203,7 +203,7 @@ movements <- structure(list(source = c("1", "1", "1"),
.Names = c("source", "destination", "t", "individual", "n"),
row.names = c(NA, -3L), class = "data.frame")

ns <- NetworkSummary(movements, root = 1, tEnd = '2010-09-01', days = 30)
ns <- NetworkSummary(movements, root = 1, tEnd = "2010-09-01", days = 30)
stopifnot(identical(ns$inDegree, 0L))

##
Expand All @@ -217,5 +217,5 @@ movements <- structure(list(source = c("1", "1", "1"),
.Names = c("source", "destination", "t", "individual", "n"),
row.names = c(NA, -3L), class = "data.frame")

ns <- NetworkSummary(movements, root = 1, tEnd = '2010-08-16', days = 15)
ns <- NetworkSummary(movements, root = 1, tEnd = "2010-08-16", days = 15)
stopifnot(identical(ns$outDegree, 2L))
96 changes: 48 additions & 48 deletions tests/misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,34 @@ library(EpiContactTrace)
##
movements <- data.frame(source = c(2L, 2L),
destination = c(1L, 2L),
t = as.Date(c('2010-10-03', '2010-10-02')))
t = as.Date(c("2010-10-03", "2010-10-02")))

ct <- Trace(movements,
root = 1L,
inBegin = as.Date('2010-09-30'),
inEnd = as.Date('2010-10-05'),
outBegin = as.Date('2010-10-05'),
outEnd = as.Date('2010-10-10'))
inBegin = as.Date("2010-09-30"),
inEnd = as.Date("2010-10-05"),
outBegin = as.Date("2010-10-05"),
outEnd = as.Date("2010-10-10"))

stopifnot(identical(ct@ingoingContacts@source, '2'))
stopifnot(identical(ct@ingoingContacts@destination, '1'))
stopifnot(identical(ct@ingoingContacts@source, "2"))
stopifnot(identical(ct@ingoingContacts@destination, "1"))

##
## Loops: Case 2
##
movements <- data.frame(source = c(2L, 2L),
destination = c(1L, 2L),
t = as.Date(c('2010-10-03', '2010-10-02')))
t = as.Date(c("2010-10-03", "2010-10-02")))

ct <- Trace(movements,
root = 2L,
inBegin = as.Date('2010-09-30'),
inEnd = as.Date('2010-10-05'),
outBegin = as.Date('2010-09-30'),
outEnd = as.Date('2010-10-10'))
inBegin = as.Date("2010-09-30"),
inEnd = as.Date("2010-10-05"),
outBegin = as.Date("2010-09-30"),
outEnd = as.Date("2010-10-10"))

stopifnot(identical(ct@outgoingContacts@source, '2'))
stopifnot(identical(ct@outgoingContacts@destination, '1'))
stopifnot(identical(ct@outgoingContacts@source, "2"))
stopifnot(identical(ct@outgoingContacts@destination, "1"))

##
## Direction: Case 1
Expand All @@ -70,13 +70,13 @@ movements <- structure(list(source = 1:7,

ct <- Trace(movements,
root = 4L,
inBegin = as.Date('2010-08-02'),
inEnd = as.Date('2010-09-01'),
outBegin = as.Date('2010-08-01'),
outEnd = as.Date('2010-08-31'))
inBegin = as.Date("2010-08-02"),
inEnd = as.Date("2010-09-01"),
outBegin = as.Date("2010-08-01"),
outEnd = as.Date("2010-08-31"))

stopifnot(identical(ct@ingoingContacts@direction, 'in'))
stopifnot(identical(ct@outgoingContacts@direction, 'out'))
stopifnot(identical(ct@ingoingContacts@direction, "in"))
stopifnot(identical(ct@outgoingContacts@direction, "out"))

##
## Direction: Case 2
Expand All @@ -92,13 +92,13 @@ movements <- structure(list(source = c(1L, 2L, 3L, 3L),

ct <- Trace(movements,
root = 4L,
inBegin = as.Date('2010-08-02'),
inEnd = as.Date('2010-09-01'),
outBegin = as.Date('2010-08-01'),
outEnd = as.Date('2010-08-31'))
inBegin = as.Date("2010-08-02"),
inEnd = as.Date("2010-09-01"),
outBegin = as.Date("2010-08-01"),
outEnd = as.Date("2010-08-31"))

stopifnot(identical(ct@ingoingContacts@direction, 'in'))
stopifnot(identical(ct@outgoingContacts@direction, 'out'))
stopifnot(identical(ct@ingoingContacts@direction, "in"))
stopifnot(identical(ct@outgoingContacts@direction, "out"))

##
## Root not in movements: Case 1
Expand All @@ -114,10 +114,10 @@ movements <- structure(list(source = c("1", "1", "1"),

ct <- Trace(movements,
root = 15L,
inBegin = as.Date('2010-08-02'),
inEnd = as.Date('2010-09-01'),
outBegin = as.Date('2010-08-01'),
outEnd = as.Date('2010-08-31'))
inBegin = as.Date("2010-08-02"),
inEnd = as.Date("2010-09-01"),
outBegin = as.Date("2010-08-01"),
outEnd = as.Date("2010-08-31"))

stopifnot(identical(InDegree(ct)$inDegree, 0L))
stopifnot(identical(OutDegree(ct)$outDegree, 0L))
Expand All @@ -134,7 +134,7 @@ movements <- structure(list(source = c("1", "1", "1"),
.Names = c("source", "destination", "t", "individual", "n"),
row.names = c(NA, -3L), class = "data.frame")

ns <- NetworkSummary(movements, root = 15, tEnd = '2010-09-01', days = 30)
ns <- NetworkSummary(movements, root = 15, tEnd = "2010-09-01", days = 30)
stopifnot(identical(ns$inDegree, 0L))

##
Expand All @@ -149,7 +149,7 @@ movements <- structure(list(source = c("1", "1", "1"),
.Names = c("source", "destination", "t", "individual", "n"),
row.names = c(NA, -3L), class = "data.frame")

ns <- NetworkSummary(movements, root = 15, tEnd = '2010-08-31', days = 30)
ns <- NetworkSummary(movements, root = 15, tEnd = "2010-08-31", days = 30)
stopifnot(identical(ns$outDegree, 0L))

##
Expand Down Expand Up @@ -296,25 +296,25 @@ movements <- structure(list(source = c("2019", "2019", "2019", "2019", "2019",
159L, 160L, 161L, 162L, 163L, 164L, 165L, 166L, 167L, 168L, 169L,
170L, 171L, 172L), class = "data.frame")

ct.1 <- Trace(movements, 2645, '2005-10-31', 90)
ct.1.df <- as(ct.1, 'data.frame')
ct.1 <- Trace(movements, 2645, "2005-10-31", 90)
ct.1.df <- as(ct.1, "data.frame")

ct.2 <- Trace(ct.1.df, 2645, '2005-10-31', 90)
ct.2.df <- as(ct.2, 'data.frame')
ct.2 <- Trace(ct.1.df, 2645, "2005-10-31", 90)
ct.2.df <- as(ct.2, "data.frame")

ct.1.df <- ct.1.df[, c('source',
'destination',
't',
'id',
'n',
'category')]
ct.1.df <- ct.1.df[, c("source",
"destination",
"t",
"id",
"n",
"category")]

ct.2.df <- ct.2.df[, c('source',
'destination',
't',
'id',
'n',
'category')]
ct.2.df <- ct.2.df[, c("source",
"destination",
"t",
"id",
"n",
"category")]

ct.1.df <- ct.1.df[order(ct.1.df$source,
ct.1.df$destination,
Expand Down

1 comment on commit 6c0f0e9

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/network-structure.R:135:1: style: Lines should not be more than 80 characters.

i <- tmp[seq_len(length(tmp) - 1)] != tmp[seq_len(length(tmp))[-1]]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:248:1: style: Lines should not be more than 80 characters.

inDays = as.integer(x@ingoingContacts@tEnd - x@ingoingContacts@tBegin),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:251:1: style: Lines should not be more than 80 characters.

outDays = as.integer(x@outgoingContacts@tEnd - x@outgoingContacts@tBegin),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:254:1: style: Lines should not be more than 80 characters.

ingoingContactChain = IngoingContactChain(x@ingoingContacts),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:255:1: style: Lines should not be more than 80 characters.

outgoingContactChain = OutgoingContactChain(x@outgoingContacts))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:261:1: style: functions should have cyclomatic complexity of less than 15, this has 38.

setMethod("NetworkSummary",
^

R/network-summary.R:315:1: style: Lines should not be more than 80 characters.

## so test that root is a integer the same way as binom.test test x
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:323:20: style: Only use double-quotes.

​              stop('invalid class of root')
                   ^~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:331:1: style: Lines should not be more than 80 characters.

if (!all(is.null(inBegin), is.null(inEnd), is.null(outBegin), is.null(outEnd))) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:332:1: style: Lines should not be more than 80 characters.

​                  stop("Use either tEnd and days or inBegin, inEnd, outBegin and outEnd in call to NetworkSummary")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:343:1: style: Lines should not be more than 80 characters.

## Test that days is a nonnegative integer the same way as binom.test test x
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:345:1: style: Lines should not be more than 80 characters.

if (any(is.na(days) | (days < 0)) || max(abs(days - daysr)) > 1e-07) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:365:1: style: Lines should not be more than 80 characters.

​          } else if (all(!is.null(inBegin), !is.null(inEnd), !is.null(outBegin), !is.null(outEnd))) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:370:1: style: Lines should not be more than 80 characters.

​                  stop("Use either tEnd and days or inBegin, inEnd, outBegin and outEnd in call to NetworkSummary")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:373:1: style: Lines should not be more than 80 characters.

​              stop("Use either tEnd and days or inBegin, inEnd, outBegin and outEnd in call to NetworkSummary")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:456:1: style: Lines should not be more than 80 characters.

​              stop("root, inBegin, inEnd, outBegin and outEnd must have equal length")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:468:24: style: Put spaces around all infix operators.

contact_chain<- .Call("networkSummary",
                      ~^

R/network-summary.R:469:1: style: Lines should not be more than 80 characters.

​                                as.integer(factor(x$source, levels = levels(nodes))),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:470:1: style: Lines should not be more than 80 characters.

​                                as.integer(factor(x$destination, levels = levels(nodes))),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:472:1: style: Lines should not be more than 80 characters.

​                                as.integer(factor(root, levels = levels(nodes))),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:489:1: style: Lines should not be more than 80 characters.

ingoingContactChain = contact_chain[["ingoingContactChain"]],
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/network-summary.R:490:1: style: Lines should not be more than 80 characters.

outgoingContactChain = contact_chain[["outgoingContactChain"]]))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/out-degree.R:119:1: style: Lines should not be more than 80 characters.

##'     Get the OutDegree for a data.frame with movements, see details and examples.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/outgoing-contact-chain.R:67:1: style: Lines should not be more than 80 characters.

##'     The \code{\link{OutgoingContactChain}} of the root within the time-interval
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/outgoing-contact-chain.R:77:1: style: Lines should not be more than 80 characters.

##'     Get the OutgoingContactChain for a data.frame with movements, see examples.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/outgoing-contact-chain.R:137:1: style: Lines should not be more than 80 characters.

​                  stop("Unable to determine OutgoingContactChain for ingoing contacts")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plot.R:82:1: style: Lines should not be more than 80 characters.

tree$ingoing$bg <- ifelse(tree$ingoing$level > 0, "white", "black")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plot.R:95:1: style: Lines should not be more than 80 characters.

tree$outgoing$bg <- ifelse(tree$outgoing$level > 0, "gray", "black")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:30:8: style: Place a space before left parenthesis, except in a function call.

for(i in seq_len(nrow(contacts))) {
       ^

R/report.R:35:1: style: Lines should not be more than 80 characters.

​                   paste(rep("<td>&nbsp;</td>", 2L * (contacts$distance[i] - 1L)), collapse = ""),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:44:1: style: Lines should not be more than 80 characters.

2L * (max(contacts$distance - 1L) - (contacts$distance[i] - 1L))),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:73:1: style: Lines should not be more than 80 characters.

​    as.character(unlist(by(contacts, sprintf("%s - %s", contacts$lhs, contacts$rhs), function(x) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:78:1: style: Lines should not be more than 80 characters.

​                   sprintf('<h3><a name="%s-%s-%s">%s %s %s</a></h3>', direction,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:81:1: style: Lines should not be more than 80 characters.

"<tr><th>Date</th><th>Id</th><th>N</th><th>Category</th><th>Source</th><th>Destination</th></tr>")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:83:12: style: Place a space before left parenthesis, except in a function call.

for(i in seq_len(nrow(x))) {
           ^

R/report.R:112:1: style: Lines should not be more than 80 characters.

​               sprintf("<h3 align='center'>Version: %s</h3>", packageVersion("EpiContactTrace")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:117:1: style: Lines should not be more than 80 characters.

​               sprintf("<tr><td>In begin date:</td><td>%s</td></tr>", x@ingoingContacts@tBegin),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:118:1: style: Lines should not be more than 80 characters.

​               sprintf("<tr><td>In end date:</td><td>%s</td></tr>", x@ingoingContacts@tEnd),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:119:1: style: Lines should not be more than 80 characters.

​               sprintf("<tr><td>In days:</td><td>%i</td></tr>", x@ingoingContacts@tEnd - x@ingoingContacts@tBegin),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:120:1: style: Lines should not be more than 80 characters.

​               sprintf("<tr><td>In degree:</td><td>%i</td></tr>", InDegree(x@ingoingContacts)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:121:1: style: Lines should not be more than 80 characters.

​               sprintf("<tr><td>Ingoing contact chain:</td><td>%i</td></tr>", IngoingContactChain(x@ingoingContacts)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:135:1: style: Lines should not be more than 80 characters.

lines <- c(lines, "<p>No ingoing contacts during the search period.</p>")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:143:1: style: Lines should not be more than 80 characters.

​               sprintf("<tr><td>Out begin date:</td><td>%s</td></tr>", x@outgoingContacts@tBegin),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:144:1: style: Lines should not be more than 80 characters.

​               sprintf("<tr><td>Out end date:</td><td>%s</td></tr>", x@outgoingContacts@tEnd),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:145:1: style: Lines should not be more than 80 characters.

​               sprintf("<tr><td>Out days:</td><td>%i</td></tr>", x@outgoingContacts@tEnd - x@outgoingContacts@tBegin),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:146:1: style: Lines should not be more than 80 characters.

​               sprintf("<tr><td>Out degree:</td><td>%i</td></tr>", OutDegree(x@outgoingContacts)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:147:1: style: Lines should not be more than 80 characters.

​               sprintf("<tr><td>Outgoing contact chain:</td><td>%i</td></tr>", OutgoingContactChain(x@outgoingContacts)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:161:1: style: Lines should not be more than 80 characters.

lines <- c(lines, "<p>No outgoing contacts during the search period.</p>")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:237:1: style: Lines should not be more than 80 characters.

##' available. To generate pdf files a TeX installation must exist to compile the
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:260:1: style: Lines should not be more than 80 characters.

##' @param template the Sweave template file to use. If none is provided, the default
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:345:1: style: Lines should not be more than 80 characters.

​              writeLines(html_report(object), con = sprintf("%s.html", object@root))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:348:1: style: Lines should not be more than 80 characters.

template <- system.file("Sweave/speak-latex.rnw", package = "EpiContactTrace")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:351:45: style: Put spaces around all infix operators.

utils::Sweave(template, syntax="SweaveSyntaxNoweb")
                                           ~^~

R/report.R:352:1: style: Lines should not be more than 80 characters.

tools::texi2pdf(sub("rnw$", "tex", basename(template)), clean = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:353:1: style: Lines should not be more than 80 characters.

​              file.rename(sub("rnw$", "pdf", basename(template)), sprintf("%s.pdf", object@root))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/report.R:400:1: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​{
^

R/shortest-paths.R:168:1: style: functions should have cyclomatic complexity of less than 15, this has 41.

setMethod("ShortestPaths",
^

R/shortest-paths.R:239:1: style: Lines should not be more than 80 characters.

if (!all(is.null(inBegin), is.null(inEnd), is.null(outBegin), is.null(outEnd))) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/shortest-paths.R:240:1: style: Lines should not be more than 80 characters.

​                  stop("Use either tEnd and days or inBegin, inEnd, outBegin and outEnd in call to ShortestPaths")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/shortest-paths.R:254:1: style: Lines should not be more than 80 characters.

if (any(is.na(days) | (days < 0)) || max(abs(days - daysr)) > 1e-07) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/shortest-paths.R:274:1: style: Lines should not be more than 80 characters.

​          } else if (all(!is.null(inBegin), !is.null(inEnd), !is.null(outBegin), !is.null(outEnd))) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/shortest-paths.R:279:1: style: Lines should not be more than 80 characters.

​                  stop("Use either tEnd and days or inBegin, inEnd, outBegin and outEnd in call to ShortestPaths")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/shortest-paths.R:282:1: style: Lines should not be more than 80 characters.

​              stop("Use either tEnd and days or inBegin, inEnd, outBegin and outEnd in call to ShortestPaths")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/shortest-paths.R:365:1: style: Lines should not be more than 80 characters.

​              stop("root, inBegin, inEnd, outBegin and outEnd must have equal length")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/shortest-paths.R:411:1: style: Lines should not be more than 80 characters.

destination = x$destination[sp$outRowid],
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/show.R:76:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​      {
      ^

R/show.R:88:1: style: Lines should not be more than 80 characters.

​              cat(sprintf("%sgoing contact chain: %i\n\n", prefix, OutgoingContactChain(object)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/show.R:91:1: style: Lines should not be more than 80 characters.

​              cat(sprintf("%sgoing contact chain: %i\n\n", prefix, IngoingContactChain(object)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/show.R:102:1: style: Lines should not be more than 80 characters.

## Rename source and destination to lhs and rhs, with respect to direction
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/show.R:111:18: style: Place a space before left parenthesis, except in a function call.

for(i in seq_len(nrow(ns))) {
                 ^

R/show.R:113:1: style: Lines should not be more than 80 characters.

​                              paste(rep(" ", (ns$distance[i] - 1) * (width + 5)), collapse=""),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/show.R:113:91: style: Put spaces around all infix operators.

​                              paste(rep(" ", (ns$distance[i] - 1) * (width + 5)), collapse=""),
                                                                                         ~^~

R/show.R:119:1: style: Lines should not be more than 80 characters.

​              cat(sprintf("No %sgoing contacts during the search period.\n", object@direction))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:167:1: style: functions should have cyclomatic complexity of less than 15, this has 56.

Trace <- function(movements,
^

R/trace.R:207:1: style: Lines should not be more than 80 characters.

if (any(is.factor(movements$destination), is.integer(movements$destination))) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:252:1: style: Lines should not be more than 80 characters.

if (any(is.factor(movements$category), is.integer(movements$category))) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:306:1: style: Lines should not be more than 80 characters.

if (!all(is.null(inBegin), is.null(inEnd), is.null(outBegin), is.null(outEnd))) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:307:1: style: Lines should not be more than 80 characters.

​            stop("Use either tEnd and days or inBegin, inEnd, outBegin and outEnd in call to Trace")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:318:1: style: Lines should not be more than 80 characters.

## Test that days is a nonnegative integer the same way as binom.test test x
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:335:31: style: Put spaces around all infix operators.

root <- rep(root, each=n.tEnd*n.days, length.out=n)
                             ~^~

R/trace.R:335:38: style: Put spaces around all infix operators.

root <- rep(root, each=n.tEnd*n.days, length.out=n)
                                    ~^~

R/trace.R:335:57: style: Put spaces around all infix operators.

root <- rep(root, each=n.tEnd*n.days, length.out=n)
                                                       ~^~

R/trace.R:336:32: style: Put spaces around all infix operators.

inEnd <- rep(tEnd, each=n.days, length.out=n)
                              ~^~

R/trace.R:336:51: style: Put spaces around all infix operators.

inEnd <- rep(tEnd, each=n.days, length.out=n)
                                                 ~^~

R/trace.R:337:42: style: Put spaces around all infix operators.

inBegin <- inEnd - rep(days, each=1, length.out=n)
                                        ~^~

R/trace.R:337:56: style: Put spaces around all infix operators.

inBegin <- inEnd - rep(days, each=1, length.out=n)
                                                      ~^~

R/trace.R:340:1: style: Lines should not be more than 80 characters.

​    } else if (all(!is.null(inBegin), !is.null(inEnd), !is.null(outBegin), !is.null(outEnd))) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:345:1: style: Lines should not be more than 80 characters.

​            stop("Use either tEnd and days or inBegin, inEnd, outBegin and outEnd in call to Trace")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:348:1: style: Lines should not be more than 80 characters.

​        stop("Use either tEnd and days or inBegin, inEnd, outBegin and outEnd in call to Trace")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:458:1: style: Lines should not be more than 80 characters.

​                            as.integer(factor(movements$source, levels = levels(nodes))),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:459:1: style: Lines should not be more than 80 characters.

​                            as.integer(factor(movements$destination, levels = levels(nodes))),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:471:16: style: Put spaces around all infix operators.

j <- (i-1) * 4
              ~^~

R/trace.R:481:1: style: Lines should not be more than 80 characters.

## Create an index to contacts, so that the result matrix can be reconstructed
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:483:12: style: Commented code should be removed.

## contacts_all <- cbind(contacts[index,], distance)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:484:1: style: Lines should not be more than 80 characters.

index <- match(apply(contacts_all, 1, function(x) paste(x, collapse="\r")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:484:76: style: Put spaces around all infix operators.

index <- match(apply(contacts_all, 1, function(x) paste(x, collapse="\r")),
                                                                          ~^~

R/trace.R:485:72: style: Put spaces around all infix operators.

​                       apply(contacts, 1, function(x) paste(x, collapse="\r")))
                                                                      ~^~

R/trace.R:509:1: style: Lines should not be more than 80 characters.

## Create an index to contacts, so that the result matrix can be reconstructed
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:511:12: style: Commented code should be removed.

## contacts_all <- cbind(contacts[index,], distance)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:512:1: style: Lines should not be more than 80 characters.

index <- match(apply(contacts_all, 1, function(x) paste(x, collapse="\r")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:512:76: style: Put spaces around all infix operators.

index <- match(apply(contacts_all, 1, function(x) paste(x, collapse="\r")),
                                                                          ~^~

R/trace.R:513:72: style: Put spaces around all infix operators.

​                       apply(contacts, 1, function(x) paste(x, collapse="\r")))
                                                                      ~^~

R/trace.R:535:1: style: Lines should not be more than 80 characters.

## Name each list item with ContactTrace objects to the name of the ContactTrace root.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:536:1: style: Lines should not be more than 80 characters.

​    names(result) <-  sapply(result, function(listItem) listItem@ingoingContacts@root)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tree.R:38:27: style: Put spaces around all infix operators.

result <- list(ingoing=NULL, outgoing=NULL)
                         ~^~

R/tree.R:38:42: style: Put spaces around all infix operators.

result <- list(ingoing=NULL, outgoing=NULL)
                                        ~^~

R/tree.R:53:12: style: Place a space before left parenthesis, except in a function call.

for(lev in rev(seq_len(max(tree.in$level)))) {
           ^

R/tree.R:54:16: style: Place a space before left parenthesis, except in a function call.

for(src in tree.in$node[tree.in$level == lev]) {
               ^

R/tree.R:64:38: style: Put spaces around all infix operators.

​                stopifnot(length(dst)>0)
                                    ~^~

R/tree.R:83:12: style: Place a space before left parenthesis, except in a function call.

for(lev in rev(seq_len(max(tree.out$level)))) {
           ^

R/tree.R:84:16: style: Place a space before left parenthesis, except in a function call.

for(dst in tree.out$node[tree.out$level == lev]) {
               ^

R/tree.R:94:38: style: Put spaces around all infix operators.

​                stopifnot(length(src)>0)
                                    ~^~

R/tree.R:131:1: style: Lines should not be more than 80 characters.

##'   \item John Q. Walker II, A node positioning algorithm for general tress.\cr
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tree.R:134:1: style: functions should have cyclomatic complexity of less than 15, this has 48.

position_tree <- function(tree,
^

R/tree.R:152:14: style: Place a space before left parenthesis, except in a function call.

while(all(!is.null(left_most),
             ^

R/tree.R:162:16: style: Place a space before left parenthesis, except in a function call.

for(i in seq_len(compare_depth)) {
               ^

R/tree.R:182:22: style: Place a space before left parenthesis, except in a function call.

while(all(!is.null(temp_node),
                     ^

R/tree.R:194:26: style: Place a space before left parenthesis, except in a function call.

while(!identical(temp_node, ancestor_neighbor)) {
                         ^

R/tree.R:196:1: style: Lines should not be more than 80 characters.

​                        set_modifier(temp_node, modifier(temp_node) + move_distance)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tree.R:226:29: style: Put spaces around all infix operators.

if (length(children)>0) {
                           ~^~

R/tree.R:241:18: style: Place a space before left parenthesis, except in a function call.

while(all(is.null(left_most),
                 ^

R/tree.R:273:30: style: Put spaces around all infix operators.

return(n[i[1]-1])
                            ~^~

R/tree.R:389:26: style: Put spaces around all infix operators.

return(s[i[1]-1])
                        ~^~

R/tree.R:398:26: style: Put spaces around all infix operators.

return(s[i[1]+1])
                        ~^~

R/tree.R:431:18: style: Place a space before left parenthesis, except in a function call.

while(has_right_sibling(right_most)) {
                 ^

tests/arguments.R:172:1: style: Lines should not be more than 80 characters.

## Use either tEnd and days or inBegin, inEnd, outBegin and outEnd in call to Trace
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/arguments.R:224:1: style: Lines should not be more than 80 characters.

tools::assertError(Trace(movements = data.frame(source = 1L, destination = 2L, t = 1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/arguments.R:235:44: style: Commas should always have a space after.

source = c(1L,NA),
                                           ^

tests/arguments.R:236:49: style: Commas should always have a space after.

destination = c(2L,3L),
                                                ^

tests/arguments.R:248:44: style: Commas should always have a space after.

source = c(1L,2L),
                                           ^

tests/arguments.R:249:49: style: Commas should always have a space after.

destination = c(2L,NA),
                                                ^

tests/arguments.R:261:44: style: Commas should always have a space after.

source = c(1L,2L),
                                           ^

tests/arguments.R:262:49: style: Commas should always have a space after.

destination = c(2L,3L),
                                                ^

tests/arguments.R:274:44: style: Commas should always have a space after.

source = c(1L,2L),
                                           ^

tests/arguments.R:275:49: style: Commas should always have a space after.

destination = c(2L,3L),
                                                ^

tests/arguments.R:394:4: style: Commented code should be removed.

## inEnd < inBegin
   ^~~~~~~~~~~~~~~

tests/arguments.R:407:4: style: Commented code should be removed.

## outEnd < outBegin
   ^~~~~~~~~~~~~~~~~

tests/contact-chain.R:51:1: style: Put spaces around all infix operators.

= "Date"), individual = c(NA_character_, NA_character_, NA_character_,
^

tests/contact-chain.R:71:31: style: Do not place spaces around code in parentheses or square brackets.

​c(NA_character_, NA_character_ ), n = c(NA_integer_, NA_integer_)),
                              ^

tests/contact-chain.R:73:1: style: Put spaces around all infix operators.

= c(NA, -2L), class = "data.frame")
^

tests/contact-chain.R:91:1: style: Put spaces around all infix operators.

= c(NA_character_, NA_character_, NA_character_, NA_character_,
^

tests/contact-chain.R:95:28: style: Do not place spaces around code in parentheses or square brackets.

"n"), row.names = c(NA, -7L ), class = "data.frame")
                           ^

tests/contact-chain.R:112:31: style: Do not place spaces around code in parentheses or square brackets.

​c(NA_character_, NA_character_ ), n = c(NA_integer_, NA_integer_)),
                              ^

tests/contact-chain.R:114:1: style: Put spaces around all infix operators.

= c(NA, -2L), class = "data.frame")
^

tests/contact-chain.R:156:37: style: Put spaces around all infix operators.

ns <- NetworkSummary(movements, root=1, tEnd="2010-10-20", days=10)
                                   ~^~

tests/contact-chain.R:156:45: style: Put spaces around all infix operators.

ns <- NetworkSummary(movements, root=1, tEnd="2010-10-20", days=10)
                                           ~^~

tests/contact-chain.R:156:64: style: Put spaces around all infix operators.

ns <- NetworkSummary(movements, root=1, tEnd="2010-10-20", days=10)
                                                              ~^~

tests/degree.R:32:1: style: Lines should not be more than 80 characters.

t = structure(c(14834, 14838, 14836, 14841), class = "Date"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:33:1: style: Lines should not be more than 80 characters.

individual = c(NA_character_, NA_character_, NA_character_, NA_character_),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:34:1: style: Lines should not be more than 80 characters.

n = c(NA_integer_, NA_integer_, NA_integer_, NA_integer_)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:35:1: style: Lines should not be more than 80 characters.

.Names = c("source", "destination", "t", "individual", "n"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:53:1: style: Lines should not be more than 80 characters.

t = structure(c(14834, 14838, 14836, 14841), class = "Date"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:54:1: style: Lines should not be more than 80 characters.

individual = c(NA_character_, NA_character_, NA_character_, NA_character_),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:55:1: style: Lines should not be more than 80 characters.

n = c(NA_integer_, NA_integer_, NA_integer_, NA_integer_)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:56:1: style: Lines should not be more than 80 characters.

.Names = c("source", "destination", "t", "individual", "n"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:67:1: style: Lines should not be more than 80 characters.

t = structure(c(14834, 14838, 14836, 14841), class = "Date"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:68:1: style: Lines should not be more than 80 characters.

individual = c(NA_character_, NA_character_, NA_character_, NA_character_),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:69:1: style: Lines should not be more than 80 characters.

n = c(NA_integer_, NA_integer_, NA_integer_, NA_integer_)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:70:1: style: Lines should not be more than 80 characters.

.Names = c("source", "destination", "t", "individual", "n"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:81:1: style: Lines should not be more than 80 characters.

t = structure(c(14834, 14838, 14836, 14841), class = "Date"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:82:1: style: Lines should not be more than 80 characters.

individual = c(NA_character_, NA_character_, NA_character_, NA_character_),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:83:1: style: Lines should not be more than 80 characters.

n = c(NA_integer_, NA_integer_, NA_integer_, NA_integer_)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:84:1: style: Lines should not be more than 80 characters.

.Names = c("source", "destination", "t", "individual", "n"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:102:1: style: Lines should not be more than 80 characters.

t = structure(c(14834, 14838, 14836, 14841), class = "Date"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:103:1: style: Lines should not be more than 80 characters.

individual = c(NA_character_, NA_character_, NA_character_, NA_character_),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:104:1: style: Lines should not be more than 80 characters.

n = c(NA_integer_, NA_integer_, NA_integer_, NA_integer_)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:105:1: style: Lines should not be more than 80 characters.

.Names = c("source", "destination", "t", "individual", "n"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:116:1: style: Lines should not be more than 80 characters.

t = structure(c(14834, 14838, 14836, 14841), class = "Date"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:117:1: style: Lines should not be more than 80 characters.

individual = c(NA_character_, NA_character_, NA_character_, NA_character_),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:118:1: style: Lines should not be more than 80 characters.

n = c(NA_integer_, NA_integer_, NA_integer_, NA_integer_)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:119:1: style: Lines should not be more than 80 characters.

.Names = c("source", "destination", "t", "individual", "n"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:130:1: style: Lines should not be more than 80 characters.

t = structure(c(14834, 14838, 14836), class = "Date"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:131:1: style: Lines should not be more than 80 characters.

individual = c(NA_character_, NA_character_, NA_character_),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:133:1: style: Lines should not be more than 80 characters.

.Names = c("source", "destination", "t", "individual", "n"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:151:1: style: Lines should not be more than 80 characters.

t = structure(c(14834, 14838, 14836), class = "Date"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:152:1: style: Lines should not be more than 80 characters.

individual = c(NA_character_, NA_character_, NA_character_),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:154:1: style: Lines should not be more than 80 characters.

.Names = c("source", "destination", "t", "individual", "n"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:158:33: style: Commas should always have a space after.

​stopifnot(identical(ns$inDegree,0L))
                                ^

tests/degree.R:165:1: style: Lines should not be more than 80 characters.

t = structure(c(14834, 14838, 14836), class = "Date"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:166:1: style: Lines should not be more than 80 characters.

individual = c(NA_character_, NA_character_, NA_character_),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:168:1: style: Lines should not be more than 80 characters.

.Names = c("source", "destination", "t", "individual", "n"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:179:1: style: Lines should not be more than 80 characters.

t = structure(c(14834, 14838, 14836), class = "Date"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:180:1: style: Lines should not be more than 80 characters.

individual = c(NA_character_, NA_character_, NA_character_),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:182:1: style: Lines should not be more than 80 characters.

.Names = c("source", "destination", "t", "individual", "n"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:200:1: style: Lines should not be more than 80 characters.

t = structure(c(14834, 14838, 14836), class = "Date"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:201:1: style: Lines should not be more than 80 characters.

individual = c(NA_character_, NA_character_, NA_character_),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/degree.R:203:1: style: Lines should not be more than 80 characters.

.Names = c("source", "destination", "t", "individual", "n"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Please sign in to comment.