Skip to content

Commit

Permalink
Roxygenize
Browse files Browse the repository at this point in the history
  • Loading branch information
stewid committed Nov 2, 2019
1 parent 155d6dc commit b3f92b2
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 59 deletions.
59 changes: 28 additions & 31 deletions man/NetworkSummary-methods.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 22 additions & 19 deletions man/Report-methods.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/position_tree.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions man/show-methods.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit b3f92b2

@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:262:1: style: functions should have cyclomatic complexity of less than 15, this has 38.

setMethod("NetworkSummary",
^

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:74: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:79: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:82: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:142: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:276: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:369:38: style: Put spaces around all infix operators.

​              Sweave(template, syntax="SweaveSyntaxNoweb")
                                    ~^~

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/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:64:38: style: Put spaces around all infix operators.

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

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

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

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

position_tree <- function(tree,
^

Please sign in to comment.