Skip to content

Commit

Permalink
code style: add space after 'if'
Browse files Browse the repository at this point in the history
  • Loading branch information
stewid committed Nov 2, 2019
1 parent 726fb83 commit 5f069bd
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 152 deletions.
4 changes: 2 additions & 2 deletions R/network-summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,13 @@ setMethod("NetworkSummary",

if (any(is.factor(x$source), is.integer(x$source))) {
x$source <- as.character(x$source)
} else if(!is.character(x$source)) {
} else if (!is.character(x$source)) {
stop("invalid class of column source in x")
}

if (any(is.factor(x$destination), is.integer(x$destination))) {
x$destination <- as.character(x$destination)
} else if(!is.character(x$destination)) {
} else if (!is.character(x$destination)) {
stop("invalid class of column destination in x")
}

Expand Down
6 changes: 3 additions & 3 deletions R/out-degree.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ setMethod("OutDegree",
signature(x = "Contacts"),
function (x)
{
if(!identical(x@direction, "out")) {
if (!identical(x@direction, "out")) {
stop("Unable to determine OutDegree for ingoing contacts")
}

Expand Down Expand Up @@ -208,11 +208,11 @@ setMethod("OutDegree",
outBegin = NULL,
outEnd = NULL)
{
if(missing(root)) {
if (missing(root)) {
stop("Missing parameters in call to OutDegree")
}

if(all(is.null(tEnd), is.null(days))) {
if (all(is.null(tEnd), is.null(days))) {
inBegin <- outBegin
inEnd <- outBegin
} else {
Expand Down
6 changes: 3 additions & 3 deletions R/outgoing-contact-chain.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ setMethod("OutgoingContactChain",
signature(x = "Contacts"),
function (x)
{
if(!identical(x@direction, "out")) {
if (!identical(x@direction, "out")) {
stop("Unable to determine OutgoingContactChain for ingoing contacts")
}

Expand Down Expand Up @@ -167,11 +167,11 @@ setMethod("OutgoingContactChain",
outBegin = NULL,
outEnd = NULL)
{
if(missing(root)) {
if (missing(root)) {
stop("Missing parameters in call to OutgoingContactChain")
}

if(all(is.null(tEnd), is.null(days))) {
if (all(is.null(tEnd), is.null(days))) {
inBegin <- outBegin
inEnd <- outBegin
} else {
Expand Down
12 changes: 6 additions & 6 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ setMethod("plot",
edges_in <- NULL
edges_out <- NULL

if(!is.null(tree$ingoing)) {
if (!is.null(tree$ingoing)) {
tree$ingoing <- position_tree(tree$ingoing, orientation="South")
tree$ingoing$bg <- ifelse(tree$ingoing$level > 0, "white", "black")
tree$ingoing$pch <- 21
Expand All @@ -91,7 +91,7 @@ setMethod("plot",
edges_in$y1 <- tree$ingoing$y[i]
}

if(!is.null(tree$outgoing)) {
if (!is.null(tree$outgoing)) {
tree$outgoing <- position_tree(tree$outgoing)
tree$outgoing$bg <- ifelse(tree$outgoing$level > 0, "gray", "black")
tree$outgoing$pch <- 21
Expand All @@ -102,23 +102,23 @@ setMethod("plot",
edges_out$x0 <- tree$outgoing$x[i]
edges_out$y0 <- tree$outgoing$y[i]

if(is.null(vertices)) {
if (is.null(vertices)) {
vertices <- tree$outgoing
} else {
vertices <- rbind(vertices, tree$outgoing[-1,])
}
}

if(!is.null(vertices)) {
if (!is.null(vertices)) {
plot(y~x, data = vertices, frame.plot = FALSE, axes = FALSE,
ann = FALSE, type = "n")

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

if(!is.null(edges_out)) {
if (!is.null(edges_out)) {
arrows(edges_out$x0, edges_out$y0, edges_out$x1, edges_out$y1,
length=0)
}
Expand Down
24 changes: 12 additions & 12 deletions R/report.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
## permissions and limitations under the Licence.

html_summary_table <- function(contacts, direction) {
if(identical(direction, "in")) {
if (identical(direction, "in")) {
arrow <- "&larr;"
} else {
arrow <- "&rarr;"
Expand Down Expand Up @@ -53,7 +53,7 @@ html_summary_table <- function(contacts, direction) {
}

html_detailed_table <- function(contacts, direction) {
if(identical(direction, "in")) {
if (identical(direction, "in")) {
arrow <- "&larr;"
} else {
arrow <- "&rarr;"
Expand Down Expand Up @@ -123,7 +123,7 @@ html_report <- function(x)
"</table>",
"</p>")

if(length(x@ingoingContacts@source) > 0L) {
if (length(x@ingoingContacts@source) > 0L) {
## Get network structure. The distance is used for indentation.
df <- NetworkStructure(x@ingoingContacts)

Expand All @@ -149,7 +149,7 @@ html_report <- function(x)
"</table>",
"</p>")

if(length(x@outgoingContacts@source) > 0L) {
if (length(x@outgoingContacts@source) > 0L) {
## Get network structure. The distance is used for indentation.
df <- NetworkStructure(x@outgoingContacts)

Expand All @@ -162,7 +162,7 @@ html_report <- function(x)
lines <- c(lines, "<p>No outgoing contacts during the search period.</p>")
}

if(length(x@ingoingContacts@source) > 0L) {
if (length(x@ingoingContacts@source) > 0L) {
lines <- c(lines,
"<hr/>",
"<h2>Direct ingoing contacts</h2>")
Expand All @@ -177,15 +177,15 @@ html_report <- function(x)
html_detailed_table(df[df$destination == df$root,], "in"))

df <- df[df$destination != df$root,]
if(nrow(df) > 0) {
if (nrow(df) > 0) {
lines <- c(lines,
"<hr/>",
"<h2>Indirect ingoing contacts</h2>",
html_detailed_table(df, "in"))
}
}

if(length(x@outgoingContacts@source) > 0L) {
if (length(x@outgoingContacts@source) > 0L) {
lines <- c(lines,
"<hr/>",
"<h2>Direct outgoing contacts</h2>")
Expand All @@ -199,7 +199,7 @@ html_report <- function(x)
html_detailed_table(df[df$source == df$root,], "out")

df <- df[df$source != df$root,]
if(nrow(df) > 0) {
if (nrow(df) > 0) {
lines <- c(lines,
"<hr/>",
"<h2>Indirect outgoing contacts</h2>",
Expand Down Expand Up @@ -343,10 +343,10 @@ setMethod("Report",
## Add the ContactTrace object to the .ct_env environment
.ct_env$ct <- object

if(identical(format, "html")) {
if (identical(format, "html")) {
writeLines(html_report(object), con = sprintf("%s.html", object@root))
} else {
if(is.null(template)) {
if (is.null(template)) {
template <- system.file("Sweave/speak-latex.rnw", package="EpiContactTrace")
}

Expand All @@ -368,11 +368,11 @@ setMethod("Report",
{
format <- match.arg(format)

if(!all(sapply(object, function(x) length(x)) == 1)) {
if (!all(sapply(object, function(x) length(x)) == 1)) {
stop("Unexpected length of list")
}

if(!all(sapply(object, function(x) class(x)) == "ContactTrace")) {
if (!all(sapply(object, function(x) class(x)) == "ContactTrace")) {
stop("Unexpected object in list")
}

Expand Down

1 comment on commit 5f069bd

@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:127:39: style: Put spaces around all infix operators.

deparse.level=0)
                                     ~^~

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:360:67: style: Put spaces around all infix operators.

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

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:182:54: style: Put spaces around all infix operators.

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

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:82:70: style: Put spaces around all infix operators.

tree$ingoing <- position_tree(tree$ingoing, orientation="South")
                                                                    ~^~

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/plot.R:118:32: style: Put spaces around all infix operators.

length=0)
                              ~^~

R/plot.R:123:32: style: Put spaces around all infix operators.

length=0)
                              ~^~

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:35:51: style: Put spaces around all infix operators.

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

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

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

R/report.R:35:73: style: Put spaces around all infix operators.

​                   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:44:32: style: Put spaces around all infix operators.

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

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

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

R/report.R:44:55: style: Put spaces around all infix operators.

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

R/report.R:44:83: style: Put spaces around all infix operators.

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:350:76: style: Put spaces around all infix operators.

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:354:76: style: Put spaces around all infix operators.

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:380:51: style: Put spaces around all infix operators.

format=format,
                                                 ~^~

R/report.R:381:53: style: Put spaces around all infix operators.

template=template))
                                                   ~^~

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:271:37: style: Put spaces around all infix operators.

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

R/shortest-paths.R:271:44: style: Put spaces around all infix operators.

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

R/shortest-paths.R:271:63: style: Put spaces around all infix operators.

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

R/shortest-paths.R:272:38: style: Put spaces around all infix operators.

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

R/shortest-paths.R:272:57: style: Put spaces around all infix operators.

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

R/shortest-paths.R:273:48: style: Put spaces around all infix operators.

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

R/shortest-paths.R:273:62: style: Put spaces around all infix operators.

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

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:379:57: style: Put spaces around all infix operators.

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

R/shortest-paths.R:380:62: style: Put spaces around all infix operators.

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

R/shortest-paths.R:382:53: style: Put spaces around all infix operators.

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

R/shortest-paths.R:401:52: style: Put spaces around all infix operators.

stringsAsFactors=FALSE)
                                                  ~^~

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

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

R/shortest-paths.R:415:58: style: Put spaces around all infix operators.

stringsAsFactors=FALSE))
                                                        ~^~

R/shortest-paths.R:428:52: style: Put spaces around all infix operators.

stringsAsFactors=FALSE)
                                                  ~^~

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')
             ^~~~~~~~~~~~~~~~~~~~

Please sign in to comment.