Skip to content

Commit

Permalink
code style: add space around infix operators
Browse files Browse the repository at this point in the history
  • Loading branch information
stewid committed Nov 2, 2019
1 parent 5f069bd commit b2a99e7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion R/network-structure.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ setMethod("NetworkStructure",
m <- cbind(object@source[object@index],
object@destination[object@index],
object@distance,
deparse.level=0)
deparse.level = 0)

## To be able to identify duplicate rows, create strings
## from rows
Expand Down
2 changes: 1 addition & 1 deletion R/network-summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ setMethod("NetworkSummary",
n.days <- length(days)
n <- n.root * n.tEnd * n.days

root <- rep(root, each = n.tEnd * n.days, length.out=n)
root <- rep(root, each = n.tEnd * n.days, length.out = n)
inEnd <- rep(tEnd, each = n.days, length.out = n)
inBegin <- inEnd - rep(days, each = 1, length.out = n)
outEnd <- inEnd
Expand Down
2 changes: 1 addition & 1 deletion R/out-degree.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ setMethod("OutDegree",
stop("Unable to determine OutDegree for ingoing contacts")
}

return(length(unique(x@destination[x@source==x@root])))
return(length(unique(x@destination[x@source == x@root])))
}
)

Expand Down
6 changes: 3 additions & 3 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ setMethod("plot",
edges_out <- NULL

if (!is.null(tree$ingoing)) {
tree$ingoing <- position_tree(tree$ingoing, orientation="South")
tree$ingoing <- position_tree(tree$ingoing, orientation = "South")
tree$ingoing$bg <- ifelse(tree$ingoing$level > 0, "white", "black")
tree$ingoing$pch <- 21
vertices <- tree$ingoing
Expand Down Expand Up @@ -115,12 +115,12 @@ setMethod("plot",

if (!is.null(edges_in)) {
arrows(edges_in$x0, edges_in$y0, edges_in$x1, edges_in$y1,
length=0)
length = 0)
}

if (!is.null(edges_out)) {
arrows(edges_out$x0, edges_out$y0, edges_out$x1, edges_out$y1,
length=0)
length = 0)
}

points(vertices$x, vertices$y, cex = 2, bg = vertices$bg,
Expand Down
12 changes: 6 additions & 6 deletions R/report.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ html_summary_table <- function(contacts, direction) {

## Pad with empty cells to the left
lines <- c(lines,
paste(rep("<td>&nbsp;</td>", 2L*(contacts$distance[i]-1L)), collapse = ""),
paste(rep("<td>&nbsp;</td>", 2L * (contacts$distance[i] - 1L)), collapse = ""),
sprintf('<td align="right">%s</td>', contacts$lhs[i]),
sprintf('<td align="right"><a href="#%s-%s-%s">%s</a></td>',
direction, contacts$lhs[i], contacts$rhs[i], arrow),
Expand All @@ -41,7 +41,7 @@ html_summary_table <- function(contacts, direction) {
## Pad with empty cells to the right
lines <- c(lines,
paste(rep("<td>&nbsp;</td>",
2L*(max(contacts$distance-1L) - (contacts$distance[i]-1L))),
2L * (max(contacts$distance - 1L) - (contacts$distance[i] - 1L))),
collapse = ""))

lines <- c(lines, "</tr>")
Expand Down Expand Up @@ -347,11 +347,11 @@ setMethod("Report",
writeLines(html_report(object), con = sprintf("%s.html", object@root))
} else {
if (is.null(template)) {
template <- system.file("Sweave/speak-latex.rnw", package="EpiContactTrace")
template <- system.file("Sweave/speak-latex.rnw", package = "EpiContactTrace")
}

utils::Sweave(template, syntax="SweaveSyntaxNoweb")
tools::texi2pdf(sub("rnw$", "tex", basename(template)), clean=TRUE)
tools::texi2pdf(sub("rnw$", "tex", basename(template)), clean = TRUE)
file.rename(sub("rnw$", "pdf", basename(template)), sprintf("%s.pdf", object@root))
unlink(sub("rnw$", "tex", basename(template)))
}
Expand All @@ -377,8 +377,8 @@ setMethod("Report",
}

lapply(object, function(x) Report(x,
format=format,
template=template))
format = format,
template = template))

invisible(NULL)
}
Expand Down
18 changes: 9 additions & 9 deletions R/shortest-paths.R
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ setMethod("ShortestPaths",
n.days <- length(days)
n <- n.root * n.tEnd * n.days

root <- rep(root, each=n.tEnd*n.days, length.out=n)
inEnd <- rep(tEnd, each=n.days, length.out=n)
inBegin <- inEnd - rep(days, each=1, length.out=n)
root <- rep(root, each = n.tEnd * n.days, length.out = n)
inEnd <- rep(tEnd, each = n.days, length.out = n)
inBegin <- inEnd - rep(days, each = 1, length.out = n)
outEnd <- inEnd
outBegin <- inBegin
} else if (all(!is.null(inBegin), !is.null(inEnd), !is.null(outBegin), !is.null(outEnd))) {
Expand Down Expand Up @@ -376,10 +376,10 @@ setMethod("ShortestPaths",
root)))

sp <- .Call("shortestPaths",
as.integer(factor(x$source, levels=levels(nodes))),
as.integer(factor(x$destination, levels=levels(nodes))),
as.integer(factor(x$source, levels = levels(nodes))),
as.integer(factor(x$destination, levels = levels(nodes))),
as.integer(julian(x$t)),
as.integer(factor(root, levels=levels(nodes))),
as.integer(factor(root, levels = levels(nodes))),
as.integer(julian(inBegin)),
as.integer(julian(inEnd)),
as.integer(julian(outBegin)),
Expand All @@ -398,7 +398,7 @@ setMethod("ShortestPaths",
source = x$source[sp$inRowid],
destination = NA_character_,
distance = sp$inDistance,
stringsAsFactors=FALSE)
stringsAsFactors = FALSE)
}

if (length(sp$outIndex)) {
Expand All @@ -412,7 +412,7 @@ setMethod("ShortestPaths",
source = NA_character_,
destination = x$destination[sp$outRowid],
distance = sp$outDistance,
stringsAsFactors=FALSE))
stringsAsFactors = FALSE))
}

if (is.null(result)) {
Expand All @@ -425,7 +425,7 @@ setMethod("ShortestPaths",
source = character(0),
destination = character(0),
distance = integer(0),
stringsAsFactors=FALSE)
stringsAsFactors = FALSE)
} else {
rownames(result) <- NULL
}
Expand Down

1 comment on commit b2a99e7

@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/in-degree.R:186:20: style: Remove spaces before the left parenthesis in a function call.

function (x) {
                   ^

R/ingoing-contact-chain.R:183:20: style: Remove spaces before the left parenthesis in a function call.

function (x) {
                   ^

R/ingoing-contact-chain.R:189:46: style: Commas should always have a space after.

return(length(setdiff(x@source,x@root)))
                                             ^

R/ingoing-contact-chain.R:197:20: style: Remove spaces before the left parenthesis in a function call.

function (x) {
                   ^

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/out-degree.R:176:20: style: Remove spaces before the left parenthesis in a function call.

function (x)
                   ^

R/out-degree.R:177:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​      {
      ^

R/out-degree.R:190:20: style: Remove spaces before the left parenthesis in a function call.

function (x)
                   ^

R/out-degree.R:191:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​      {
      ^

R/out-degree.R:210:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​      {
      ^

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:135:20: style: Remove spaces before the left parenthesis in a function call.

function (x)
                   ^

R/outgoing-contact-chain.R:136:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​      {
      ^

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

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

R/outgoing-contact-chain.R:141:47: style: Commas should always have a space after.

return(length(setdiff(x@destination,x@root)))
                                              ^

R/outgoing-contact-chain.R:149:20: style: Remove spaces before the left parenthesis in a function call.

function (x)
                   ^

R/outgoing-contact-chain.R:150:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​      {
      ^

R/outgoing-contact-chain.R:169:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​      {
      ^

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

​      {
      ^

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

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

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

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

R/plot.R:108:64: style: Commas should always have a space after.

vertices <- rbind(vertices, tree$outgoing[-1,])
                                                               ^

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:62:77: style: Commas should always have a space after.

contacts <- contacts[order(contacts$t, contacts$id, decreasing = FALSE),]
                                                                            ^

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:104:1: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​{
^

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

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

R/report.R:118: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:119: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:120: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:121: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:122: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:136: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:144: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:145: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:146: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:147: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:148: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:162: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:177:69: style: Commas should always have a space after.

​                   html_detailed_table(df[df$destination == df$root,], "in"))
                                                                    ^

R/report.R:179:44: style: Commas should always have a space after.

df <- df[df$destination != df$root,]
                                           ^

R/report.R:199:53: style: Commas should always have a space after.

​        html_detailed_table(df[df$source == df$root,], "out")
                                                    ^

R/report.R:201:39: style: Commas should always have a space after.

df <- df[df$source != df$root,]
                                      ^

R/report.R:238: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:261: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:333:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​      {
      ^

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

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

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

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

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

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

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

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

R/report.R:355: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:368:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​      {
      ^

R/report.R:403: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:137:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​      {
      ^

R/shortest-paths.R:139:44: style: Commas should always have a space after.

ns.in <- ns[ns$direction == "in",]
                                           ^

R/shortest-paths.R:140:46: style: Commas should always have a space after.

ns.out <- ns[ns$direction == "out",]
                                             ^

R/shortest-paths.R:144:66: style: Commas should always have a space after.

ns.in <- ns.in[order(ns.in$distance, ns.in$source),]
                                                                 ^

R/shortest-paths.R:145:56: style: Commas should always have a space after.

ns.in <- ns.in[!duplicated(ns.in$source),]
                                                       ^

R/shortest-paths.R:151:75: style: Commas should always have a space after.

ns.out <- ns.out[order(ns.out$distance, ns.out$destination),]
                                                                          ^

R/shortest-paths.R:152:64: style: Commas should always have a space after.

ns.out <- ns.out[!duplicated(ns.out$destination),]
                                                               ^

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

setMethod("ShortestPaths",
^

R/shortest-paths.R:179:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​      {
      ^

R/shortest-paths.R:241: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:242: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:256: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:276: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:281: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:284: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:367: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:413:1: style: Lines should not be more than 80 characters.

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

R/show.R:75:20: style: Remove spaces before the left parenthesis in a function call.

function (object)
                   ^

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/show.R:128:20: style: Remove spaces before the left parenthesis in a function call.

function (object)
                   ^

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

​      {
      ^

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

​{
^

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

Trace <- function(movements,
^

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

​{
^

R/trace.R:182:14: style: Only use double-quotes.

​        stop('Missing parameters in call to Trace')
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:186:14: style: Only use double-quotes.

​        stop('movements must be a data.frame')
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:189:16: style: Only use double-quotes.

if (!all(c('source', 'destination', 't') %in% names(movements))) {
               ^~~~~~~~

R/trace.R:189:26: style: Only use double-quotes.

if (!all(c('source', 'destination', 't') %in% names(movements))) {
                         ^~~~~~~~~~~~~

R/trace.R:189:41: style: Only use double-quotes.

if (!all(c('source', 'destination', 't') %in% names(movements))) {
                                        ^~~

R/trace.R:190:14: style: Only use double-quotes.

​        stop('movements must contain the columns source, destination and t.')
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:199:14: style: Only use double-quotes.

​        stop('invalid class of column source in movements')
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:203:14: style: Only use double-quotes.

​        stop('source in movements contains NA')
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

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

R/trace.R:212:14: style: Only use double-quotes.

​        stop('invalid class of column destination in movements')
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:216:14: style: Only use double-quotes.

​        stop('destination in movements contains NA')
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:225:40: style: Only use double-quotes.

if (!identical(class(movements$t), 'Date')) {
                                       ^~~~~~

R/trace.R:226:14: style: Only use double-quotes.

​        stop('invalid class of column t in movements')
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:230:14: style: Only use double-quotes.

​        stop('t in movements contains NA')
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:233:9: style: Only use double-quotes.

if ('n' %in% names(movements)) {
        ^~~

R/trace.R:237:18: style: Only use double-quotes.

​            stop('invalid class of column n in movements')
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:243:9: style: Only use double-quotes.

if ('id' %in% names(movements)) {
        ^~~~

R/trace.R:247:18: style: Only use double-quotes.

​            stop('invalid class of column id in movements')
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:253:9: style: Only use double-quotes.

if ('category' %in% names(movements)) {
        ^~~~~~~~~~

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

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

R/trace.R:257:18: style: Only use double-quotes.

​            stop('invalid class of column category in movements')
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/trace.R:264:40: style: Only use double-quotes.

if (!identical(names(movements), c('source',
                                       ^~~~~~~~

R/trace.R:265:39: style: Only use double-quotes.

'destination',
                                      ^~~~~~~~~~~~~

R/trace.R:266:39: style: Only use double-quotes.

't',
                                      ^~~

R/trace.R:267:39: style: Only use double-quotes.

'id',
                                      ^~~~

R/trace.R:268:39: style: Only use double-quotes.

'n',
                                      ^~~

R/trace.R:269:39: style: Only use double-quotes.

'category'))) {
                                      ^~~~~~~~~~

R/trace.R:270:36: style: Only use double-quotes.

movements <- movements[, c('source',
                                   ^~~~~~~~

R/trace.R:271:36: style: Only use double-quotes.

'destination',
                                   ^~~~~~~~~~~~~

R/trace.R:272:36: style: Only use double-quotes.

't',
                                   ^~~

R/trace.R:273:36: style: Only use double-quotes.

'id',
                                   ^~~~

R/trace.R:274:36: style: Only use double-quotes.

'n',
                                   ^~~

R/trace.R:275:36: style: Only use double-quotes.

'category')]
                                   ^~~~~~~~~~

R/trace.R:296:14: style: Only use double-quotes.

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

R/trace.R:300:14: style: Only use double-quotes.

​        stop('root contains NA')
             ^~~~~~~~~~~~~~~~~~

R/trace.R:308: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:309: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:309:18: style: Only use double-quotes.

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

R/trace.R:316:37: style: Only use double-quotes.

if (!identical(class(tEnd), 'Date')) {
                                    ^~~~~~

R/trace.R:320: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:337:31: style: Put spaces around all infix operators.

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

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

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

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

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

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

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

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

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

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

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

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

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

R/trace.R:342: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:347: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:347:18: style: Only use double-quotes.

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

R/trace.R:350: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:350:14: style: Only use double-quotes.

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

R/trace.R:360:36: style: Only use double-quotes.

if (!identical(class(inBegin), 'Date')) {
                                   ^~~~~~

R/trace.R:365:14: style: Only use double-quotes.

​        stop('inBegin contains NA')
             ^~~~~~~~~~~~~~~~~~~~~

R/trace.R:375:34: style: Only use double-quotes.

if (!identical(class(inEnd), 'Date')) {
                                 ^~~~~~

R/trace.R:380:14: style: Only use double-quotes.

​        stop('inEnd contains NA')
             ^~~~~~~~~~~~~~~~~~~

R/trace.R:390:37: style: Only use double-quotes.

if (!identical(class(outBegin), 'Date')) {
                                    ^~~~~~

R/trace.R:395:14: style: Only use double-quotes.

​        stop('outBegin contains NA')
             ^~~~~~~~~~~~~~~~~~~~~~

R/trace.R:405:35: style: Only use double-quotes.

if (!identical(class(outEnd), 'Date')) {
                                  ^~~~~~

R/trace.R:410:14: style: Only use double-quotes.

​        stop('outEnd contains NA')
             ^~~~~~~~~~~~~~~~~~~~

R/trace.R:417:14: style: Only use double-quotes.

​        stop('inEnd < inBegin')
             ^~~~~~~~~~~~~~~~~

R/trace.R:421:14: style: Only use double-quotes.

​        stop('outEnd < outBegin')
             ^~~~~~~~~~~~~~~~~~~

R/trace.R:433:14: style: Only use double-quotes.

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

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

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

R/trace.R:460:71: style: Put spaces around all infix operators.

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

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

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

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

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

R/trace.R:463:59: style: Put spaces around all infix operators.

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

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

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

R/trace.R:483: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:485:12: style: Commented code should be removed.

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

R/trace.R:486: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:486:76: style: Put spaces around all infix operators.

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

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

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

R/trace.R:489:32: style: Only use double-quotes.

ingoingContacts <- new('Contacts',
                               ^~~~~~~~~~

R/trace.R:493:51: style: Commas should always have a space after.

source = contacts[,1],
                                                  ^

R/trace.R:494:56: style: Commas should always have a space after.

destination = contacts[,2],
                                                       ^

R/trace.R:495:46: style: Commas should always have a space after.

t = contacts[,3],
                                             ^

R/trace.R:496:47: style: Commas should always have a space after.

id = contacts[,4],
                                              ^

R/trace.R:497:46: style: Commas should always have a space after.

n = contacts[,5],
                                             ^

R/trace.R:498:53: style: Commas should always have a space after.

category = contacts[,6],
                                                    ^

R/trace.R:501:44: style: Only use double-quotes.

direction = 'in')
                                           ^~~~

R/trace.R:511: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:513:12: style: Commented code should be removed.

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

R/trace.R:514: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:514:76: style: Put spaces around all infix operators.

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

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

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

R/trace.R:517:33: style: Only use double-quotes.

outgoingContacts <- new('Contacts',
                                ^~~~~~~~~~

R/trace.R:521:52: style: Commas should always have a space after.

source = contacts[,1],
                                                   ^

R/trace.R:522:57: style: Commas should always have a space after.

destination = contacts[,2],
                                                        ^

R/trace.R:523:47: style: Commas should always have a space after.

t = contacts[,3],
                                              ^

Please sign in to comment.