New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mergeRaster when triggering mosaic now takes function from user #55

Merged
merged 3 commits into from Jan 28, 2019

Conversation

Projects
None yet
3 participants
@tati-micheletti
Copy link
Contributor

tati-micheletti commented Jan 8, 2019

No description provided.

@lintr-bot

This comment was marked as off-topic.

Copy link

lintr-bot commented on 1d55a46 Jan 8, 2019

inst/examples/example_distanceFromEachPoint.R:37:2: style: Commented code should be removed.

#beginCluster(3) # can do parallel
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/examples/example_distanceFromEachPoint.R:40:2: style: Commented code should be removed.

#endCluster() # if beginCluster was run
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:83:11: style: Do not place spaces around code in parentheses or square brackets.

if ( method != "RMexp") {
          ^

R/initialize.R:88:1: style: Lines should not be more than 100 characters.

map <- raster(RandomFields::RFsimulate(model, y = 1:ncSpeedup, x = 1:nrSpeedup, grid = TRUE, ...))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:223:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPoints <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:247:4: style: Commented code should be removed.

#y <- spTransform(x, areaCRS)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:263:3: style: Variable or function name should be lowerCamelCase.

X <- c(jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxX - minX) + minX)),
  ^

R/initialize.R:265:3: style: Variable or function name should be lowerCamelCase.

Y <- c(jitter(sort(rbeta(nPoints / 2, betaPar, betaPar) * (maxY - meanY) + meanY)),
  ^

R/initialize.R:269:3: style: Variable or function name should be lowerCamelCase.

Sr1 <- Polygon(cbind(X + xAdd, Y + yAdd))
  ^~~

R/initialize.R:270:3: style: Variable or function name should be lowerCamelCase.

Srs1 <- Polygons(list(Sr1), "s1")
  ^~~~

R/initialize.R:283:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.matrix <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~

R/initialize.R:300:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPolygons <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

while(need) {
       ^

R/initialize.R:407:3: style: Commented code should be removed.

# ### INCORPORATE RELEVANT PARTS OF THIS OLD INIT FUNCTION INTO INITCOORDS()
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:412:3: style: Commented code should be removed.

# #'                      (currently only \code{RasterLayer} or
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:413:3: style: Commented code should be removed.

# #'                      \code{SpatialPolygonsDataFrame}) accepted.
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:423:7: style: Commented code should be removed.

#     ext <- extent(agentlocation)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:425:9: style: Commented code should be removed.

#       #            nonNAs <- !is.na(getvalue(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:426:9: style: Commented code should be removed.

#       nonNAs <- !is.na(getValues(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:427:9: style: Commented code should be removed.

#       wh.nonNAs <- which(nonNAs)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:428:9: style: Commented code should be removed.

#       #            ProbInit.v <- cumsum(getvalue(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:429:9: style: Commented code should be removed.

#       ProbInit.v <- cumsum(getValues(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:431:11: style: Commented code should be removed.

#         ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:432:11: style: Commented code should be removed.

#         fI <- findInterval(ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:433:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[fI]
          ^~~~~~~~~~~~~~~~~~~~

R/initialize.R:434:11: style: Commented code should be removed.

#         last.ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:435:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:436:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:438:11: style: Commented code should be removed.

#         #                va <- getvalue(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:439:11: style: Commented code should be removed.

#         va <- getValues(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:440:11: style: Commented code should be removed.

#         ran <- runif(length(va), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:441:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:443:11: style: Commented code should be removed.

#         last.ran <- runif(length(fI2), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:444:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v) + 1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:445:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:447:11: style: Commented code should be removed.

#         #                last.ran <- runif(length(fI2),0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:448:11: style: Commented code should be removed.

#         #                last.fI2 <- wh.nonNAs[last.ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:451:11: style: Commented code should be removed.

#         position <- xyFromCell(agentlocation,fI2,spatial = TRUE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:453:11: style: Commented code should be removed.

#         position <- coordinates(agentlocation)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:455:11: style: Commented code should be removed.

#         stop("need raster layer or Spatial Points object")
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:457:9: style: Commented code should be removed.

#       numagents <- length(position)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:465:13: style: Commented code should be removed.

#           colnames(xy) = c("x", "y")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:466:13: style: Commented code should be removed.

#           position <- SpatialPoints(xy)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:467:13: style: Commented code should be removed.

#           position <- SpatialPoints(sampleRandom(agentlocation, numagents, xy = TRUE, sp = TRUE))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:469:13: style: Commented code should be removed.

#           sam <- sample(1:length(agentlocation),numagents)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:470:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation[sam,])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:472:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:479:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:481:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:483:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:491:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:495:7: style: Commented code should be removed.

#     stop("Need to provide agentlocation, which can be a map layer")
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:497:5: style: Commented code should be removed.

#   heading1 <- runif(numagents, 0, 360)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:498:5: style: Commented code should be removed.

#   distance <- runif(numagents, 0.1, 10)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:500:5: style: Commented code should be removed.

#   .Object@ID <- as.character(1:numagents)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:501:5: style: Commented code should be removed.

#   .Object@spatial <- position
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:502:5: style: Commented code should be removed.

#   .Object@heading <- heading1
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:503:5: style: Commented code should be removed.

#   .Object@distance <- distance
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:505:5: style: Commented code should be removed.

#   return(.Object)
    ^~~~~~~~~~~~~~~

R/initialize.R:510:32: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                               ^

R/initialize.R:510:37: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                    ^

R/initialize.R:510:52: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                   ^

R/initialize.R:510:55: style: Put spaces around all infix operators.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                     ~^~

R/initialize.R:510:56: style: Only use double-quotes.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                       ^~

R/initialize.R:514:22: style: Put spaces around all infix operators.

​  (floor((long + 180)/6) %% 60) + 1
                    ~^~

R/mapReduce.R:53:3: style: Variable or function name should be lowerCamelCase.

BsumVec <- reduced[fullRasterVals] # join
  ^~~~~~~

R/neighbourhood.R:114:21: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                    ^~~~~~~~~~~~~~

R/neighbourhood.R:114:45: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                                            ^~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:233:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:238:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:297:1: style: Lines should not be more than 100 characters.

​              ((from %% numCol + to %% numCol) == 1))# | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:806:29: style: Variable or function name should be lowerCamelCase.

setGeneric("wrap", function(X, bounds, withHeading) {
                            ^

R/neighbourhood.R:815:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:832:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:842:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:843:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:852:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:853:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:862:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:865:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
      ^

R/neighbourhood.R:877:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:902:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:903:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:912:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:915:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:1052:40: style: Commas should always have a space after.

cc <- cbind(pureCircle2[, "x"] - xy[,"x"], pureCircle2[, "y"] - xy[, "y"])
                                       ^

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

1 / sqrt(var * 2 * pi) * exp(-((theta - mu + 2 * pi * k) ^ 2) / (2 * var))
                                  ^

R/probability.R:44:3: style: Variable or function name should be lowerCamelCase.

Next <- term(theta, mu, var, k)
  ^~~~

R/probability.R:45:3: style: Variable or function name should be lowerCamelCase.

Last <- Next
  ^~~~

R/RcppExports.R:68:20: style: Variable or function name should be lowerCamelCase.

runifC <- function(N) {
                   ^

R/RcppExports.R:71:1: style: Trailing blank lines are superfluous.

^

R/SELES.R:53:23: style: Variable or function name should be lowerCamelCase.

numAgents <- function(N, probInit) {
                      ^

R/splitRaster.R:116:1: style: Lines should not be more than 100 characters.

​      clusterApplyLB(cl = cl, x = seq_along(extents), fun = croppy, e = extents, r = r, path = path, rType = rType)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:538:8: style: Commented code should be removed.

#isNASpreadProb <- is.na(spreadProb[])
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:540:11: style: Commented code should be removed.

#   isNASpreadProb <- is.na(spreadProb[])
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:541:11: style: Commented code should be removed.

#   spreadProb[isNASpreadProb] <- 0L
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:942:41: style: Place a space before left parenthesis, except in a function call.

notDupsEvents <- notDups[-(1:(nrSpreads - nrPotentials))]
                                        ^

R/spread2.R:5:1: style: Lines should not be more than 100 characters.

"quantityAdj", "quantityAdj2", "state", "size", "tooBigByNCells", "V1", "proportion"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:674:12: style: Commented code should be removed.

#pureCircle <- unique(pureCircle)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:759:13: style: Commented code should be removed.

# colnamesDtPot <- colnames(dtPotential)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:760:13: style: Commented code should be removed.

# ll <-  lapply(colnamesDtPot, function(x) dtPotential[[x]][!spreadProbNA])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:761:13: style: Commented code should be removed.

# names(ll) <- colnamesDtPot
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:762:13: style: Commented code should be removed.

# dtPotential <- as.data.table(ll)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:772:1: style: Lines should not be more than 100 characters.

​                                                                   .I[sample.int(length(numNeighs), size = numNeighs, prob = spreadProbRel)],
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:787:7: style: Variable or function name should be lowerCamelCase.

NAaSP <- !is.na(actualSpreadProb)
      ^~~~~

R/spread2.R:789:42: style: Commas should always have a space after.

dtPotential <- dtPotential[NAaSP,]
                                         ^

R/spread2.R:830:1: style: Lines should not be more than 100 characters.

# this is to prevent overlap within an event... in some cases, overlap within event is desired, so skip this block
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:1: style: Lines should not be more than 100 characters.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:10: style: Commented code should be removed.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:6:11: style: Commented code should be removed.

​    cat("#START##############\n", file = tmpExFile, append = FALSE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:17:5: style: Commas should never have a space before.

​  } , add = TRUE)
   ~^

tests/testthat/test-mapReduce.R:23:4: style: Commented code should be removed.

#expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:27:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:28:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:31:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:35:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:36:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:37:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:38:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:42:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:44:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:46:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:47:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(biomass))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:49:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:50:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:51:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:52:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:56:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:57:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:60:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:64:5: style: Commented code should be removed.

#   ras <- raster(extent(0, 15, 0, 15), res = 1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:65:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes = 5, speedup = 1, p = 0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:67:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:71:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu = 4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:73:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:75:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:76:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:77:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:81:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:82:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:85:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:89:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:90:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:91:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:92:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:96:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:98:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R💯5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:101:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:102:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:4:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:5:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:10:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:13:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:33:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:34:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:39:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:42:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:52:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:55:1: style: Lines should not be more than 100 characters.

​test_that("mergeRaster will use mosaic with default mean if rasters are resampled and fun if passed", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:58:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:59:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:64:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:67:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-randomPolygon.R:24:60: style: Put spaces around all infix operators.

​  expect_true(base::abs(base::abs(polyArea - area)) <  area/4) ## TODO: why is this area/4?
                                                          ~^~

tests/testthat/test-randomPolygon.R:28:3: style: Variable or function name should be lowerCamelCase.

centerSP_UTM <- sp::spTransform(centerSP, CRSobj = raster::crs(poly1InUTM))
  ^~~~~~~~~~~~

tests/testthat/test-randomPolygon.R:30:1: style: Lines should not be more than 100 characters.

​  expect_true(raster::pointDistance(centerSP_UTM, polyCenter, lonlat = FALSE) < 100) ## TODO: appropriate test?
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:148:38: style: Commas should always have a space after.

​  expect_identical(dataType(y4[[1]]),"INT1U")
                                     ^

tests/testthat/test-splitRaster.R:165:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-parallel") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:168:8: style: Commented code should be removed.

#detach("package:raster")
       ^~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:226:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-large") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:264:4: style: Commented code should be removed.

#expect_equal(min(values(m)), min(values(r))) ## Error: cannot allocate vector of size 4.8 Gb
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:283:4: style: Commented code should be removed.

#expect_equal(max(values(m1)), max(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:284:4: style: Commented code should be removed.

#expect_equal(min(values(m1)), min(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread.R:209:1: style: Lines should not be more than 100 characters.

if (interactive()) Plot(circEdge, addTo = "circs", cols = c("transparent", rainbow(numCircs)[whCirc]))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:148:4: style: Commented code should be removed.

#quickDT <- data.table(id = seq_along(sams), initialPixels = sams, key = "id")
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:150:4: style: Commented code should be removed.

#cirOut <- quickDT[cirOut, on = ]
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:473:1: style: Lines should not be more than 100 characters.

##                                    expr       min        lq      mean   median        uq       max neval
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:474:1: style: Lines should not be more than 100 characters.

##         iterativeFun(ras, FALSE, n, sp)  3.096979 12.642477  73.02248 35.17520  91.10528  764.4073   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:475:1: style: Lines should not be more than 100 characters.

##      nonIterativeFun(ras, FALSE, n, sp)  1.509484  6.555565  31.18444 14.91066  42.78317  158.5237   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:476:1: style: Lines should not be more than 100 characters.

##           origSpread(ras, FALSE, n, sp)  5.154006  7.555631  14.87158 11.49005  17.50599  231.5487   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:477:1: style: Lines should not be more than 100 characters.

## origSpreadIterations(ras, FALSE, n, sp) 10.754669 51.524368 141.48620 93.61996 169.10808 2110.2683   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:688:38: style: Place a space before left parenthesis, except in a function call.

ciCentre[seq_len(ncell(ciCentre))[-(ncell(ciCentre) / 2 - ncol(ciCentre) / 2)]] <- NA_integer_
                                     ^

tests/testthat/test-spread2.R:884:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:886:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0.8, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:891:3: style: Variable or function name should be lowerCamelCase.

M <- matrix(0.8, nrow = 50, ncol = 50)
  ^

tests/testthat/test-spread2.R:898:35: style: Put spaces around all infix operators.

start <- c(50, length(landscape)-49)
                                 ~^~

tests/testthat/test-spread2.R:902:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = persistRas, iterations = 10, directions = 8L,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:916:14: style: Use <-, not =, for assignment.

spreadProb = landscape
             ^

tests/testthat/test-spread2.R:918:72: style: Commas should always have a space after.

​  expect_silent(spread2(landscape = landscape, spreadProb = spreadProb,start = start,
                                                                       ^
@lintr-bot

This comment was marked as off-topic.

Copy link

lintr-bot commented Jan 8, 2019

inst/examples/example_distanceFromEachPoint.R:37:2: style: Commented code should be removed.

#beginCluster(3) # can do parallel
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/examples/example_distanceFromEachPoint.R:40:2: style: Commented code should be removed.

#endCluster() # if beginCluster was run
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:83:11: style: Do not place spaces around code in parentheses or square brackets.

if ( method != "RMexp") {
          ^

R/initialize.R:88:1: style: Lines should not be more than 100 characters.

map <- raster(RandomFields::RFsimulate(model, y = 1:ncSpeedup, x = 1:nrSpeedup, grid = TRUE, ...))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:223:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPoints <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:247:4: style: Commented code should be removed.

#y <- spTransform(x, areaCRS)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:263:3: style: Variable or function name should be lowerCamelCase.

X <- c(jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxX - minX) + minX)),
  ^

R/initialize.R:265:3: style: Variable or function name should be lowerCamelCase.

Y <- c(jitter(sort(rbeta(nPoints / 2, betaPar, betaPar) * (maxY - meanY) + meanY)),
  ^

R/initialize.R:269:3: style: Variable or function name should be lowerCamelCase.

Sr1 <- Polygon(cbind(X + xAdd, Y + yAdd))
  ^~~

R/initialize.R:270:3: style: Variable or function name should be lowerCamelCase.

Srs1 <- Polygons(list(Sr1), "s1")
  ^~~~

R/initialize.R:283:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.matrix <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~

R/initialize.R:300:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPolygons <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

while(need) {
       ^

R/initialize.R:407:3: style: Commented code should be removed.

# ### INCORPORATE RELEVANT PARTS OF THIS OLD INIT FUNCTION INTO INITCOORDS()
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:412:3: style: Commented code should be removed.

# #'                      (currently only \code{RasterLayer} or
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:413:3: style: Commented code should be removed.

# #'                      \code{SpatialPolygonsDataFrame}) accepted.
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:423:7: style: Commented code should be removed.

#     ext <- extent(agentlocation)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:425:9: style: Commented code should be removed.

#       #            nonNAs <- !is.na(getvalue(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:426:9: style: Commented code should be removed.

#       nonNAs <- !is.na(getValues(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:427:9: style: Commented code should be removed.

#       wh.nonNAs <- which(nonNAs)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:428:9: style: Commented code should be removed.

#       #            ProbInit.v <- cumsum(getvalue(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:429:9: style: Commented code should be removed.

#       ProbInit.v <- cumsum(getValues(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:431:11: style: Commented code should be removed.

#         ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:432:11: style: Commented code should be removed.

#         fI <- findInterval(ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:433:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[fI]
          ^~~~~~~~~~~~~~~~~~~~

R/initialize.R:434:11: style: Commented code should be removed.

#         last.ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:435:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:436:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:438:11: style: Commented code should be removed.

#         #                va <- getvalue(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:439:11: style: Commented code should be removed.

#         va <- getValues(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:440:11: style: Commented code should be removed.

#         ran <- runif(length(va), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:441:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:443:11: style: Commented code should be removed.

#         last.ran <- runif(length(fI2), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:444:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v) + 1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:445:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:447:11: style: Commented code should be removed.

#         #                last.ran <- runif(length(fI2),0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:448:11: style: Commented code should be removed.

#         #                last.fI2 <- wh.nonNAs[last.ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:451:11: style: Commented code should be removed.

#         position <- xyFromCell(agentlocation,fI2,spatial = TRUE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:453:11: style: Commented code should be removed.

#         position <- coordinates(agentlocation)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:455:11: style: Commented code should be removed.

#         stop("need raster layer or Spatial Points object")
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:457:9: style: Commented code should be removed.

#       numagents <- length(position)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:465:13: style: Commented code should be removed.

#           colnames(xy) = c("x", "y")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:466:13: style: Commented code should be removed.

#           position <- SpatialPoints(xy)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:467:13: style: Commented code should be removed.

#           position <- SpatialPoints(sampleRandom(agentlocation, numagents, xy = TRUE, sp = TRUE))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:469:13: style: Commented code should be removed.

#           sam <- sample(1:length(agentlocation),numagents)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:470:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation[sam,])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:472:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:479:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:481:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:483:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:491:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:495:7: style: Commented code should be removed.

#     stop("Need to provide agentlocation, which can be a map layer")
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:497:5: style: Commented code should be removed.

#   heading1 <- runif(numagents, 0, 360)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:498:5: style: Commented code should be removed.

#   distance <- runif(numagents, 0.1, 10)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:500:5: style: Commented code should be removed.

#   .Object@ID <- as.character(1:numagents)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:501:5: style: Commented code should be removed.

#   .Object@spatial <- position
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:502:5: style: Commented code should be removed.

#   .Object@heading <- heading1
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:503:5: style: Commented code should be removed.

#   .Object@distance <- distance
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:505:5: style: Commented code should be removed.

#   return(.Object)
    ^~~~~~~~~~~~~~~

R/initialize.R:510:32: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                               ^

R/initialize.R:510:37: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                    ^

R/initialize.R:510:52: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                   ^

R/initialize.R:510:55: style: Put spaces around all infix operators.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                     ~^~

R/initialize.R:510:56: style: Only use double-quotes.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                       ^~

R/initialize.R:514:22: style: Put spaces around all infix operators.

​  (floor((long + 180)/6) %% 60) + 1
                    ~^~

R/mapReduce.R:53:3: style: Variable or function name should be lowerCamelCase.

BsumVec <- reduced[fullRasterVals] # join
  ^~~~~~~

R/neighbourhood.R:114:21: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                    ^~~~~~~~~~~~~~

R/neighbourhood.R:114:45: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                                            ^~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:233:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:238:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:297:1: style: Lines should not be more than 100 characters.

​              ((from %% numCol + to %% numCol) == 1))# | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:806:29: style: Variable or function name should be lowerCamelCase.

setGeneric("wrap", function(X, bounds, withHeading) {
                            ^

R/neighbourhood.R:815:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:832:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:842:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:843:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:852:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:853:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:862:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:865:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
      ^

R/neighbourhood.R:877:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:902:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:903:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:912:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:915:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:1052:40: style: Commas should always have a space after.

cc <- cbind(pureCircle2[, "x"] - xy[,"x"], pureCircle2[, "y"] - xy[, "y"])
                                       ^

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

1 / sqrt(var * 2 * pi) * exp(-((theta - mu + 2 * pi * k) ^ 2) / (2 * var))
                                  ^

R/probability.R:44:3: style: Variable or function name should be lowerCamelCase.

Next <- term(theta, mu, var, k)
  ^~~~

R/probability.R:45:3: style: Variable or function name should be lowerCamelCase.

Last <- Next
  ^~~~

R/RcppExports.R:68:20: style: Variable or function name should be lowerCamelCase.

runifC <- function(N) {
                   ^

R/RcppExports.R:71:1: style: Trailing blank lines are superfluous.

^

R/SELES.R:53:23: style: Variable or function name should be lowerCamelCase.

numAgents <- function(N, probInit) {
                      ^

R/splitRaster.R:116:1: style: Lines should not be more than 100 characters.

​      clusterApplyLB(cl = cl, x = seq_along(extents), fun = croppy, e = extents, r = r, path = path, rType = rType)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:538:8: style: Commented code should be removed.

#isNASpreadProb <- is.na(spreadProb[])
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:540:11: style: Commented code should be removed.

#   isNASpreadProb <- is.na(spreadProb[])
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:541:11: style: Commented code should be removed.

#   spreadProb[isNASpreadProb] <- 0L
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:942:41: style: Place a space before left parenthesis, except in a function call.

notDupsEvents <- notDups[-(1:(nrSpreads - nrPotentials))]
                                        ^

R/spread2.R:5:1: style: Lines should not be more than 100 characters.

"quantityAdj", "quantityAdj2", "state", "size", "tooBigByNCells", "V1", "proportion"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:674:12: style: Commented code should be removed.

#pureCircle <- unique(pureCircle)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:759:13: style: Commented code should be removed.

# colnamesDtPot <- colnames(dtPotential)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:760:13: style: Commented code should be removed.

# ll <-  lapply(colnamesDtPot, function(x) dtPotential[[x]][!spreadProbNA])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:761:13: style: Commented code should be removed.

# names(ll) <- colnamesDtPot
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:762:13: style: Commented code should be removed.

# dtPotential <- as.data.table(ll)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:772:1: style: Lines should not be more than 100 characters.

​                                                                   .I[sample.int(length(numNeighs), size = numNeighs, prob = spreadProbRel)],
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:787:7: style: Variable or function name should be lowerCamelCase.

NAaSP <- !is.na(actualSpreadProb)
      ^~~~~

R/spread2.R:789:42: style: Commas should always have a space after.

dtPotential <- dtPotential[NAaSP,]
                                         ^

R/spread2.R:830:1: style: Lines should not be more than 100 characters.

# this is to prevent overlap within an event... in some cases, overlap within event is desired, so skip this block
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:1: style: Lines should not be more than 100 characters.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:10: style: Commented code should be removed.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:6:11: style: Commented code should be removed.

​    cat("#START##############\n", file = tmpExFile, append = FALSE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:17:5: style: Commas should never have a space before.

​  } , add = TRUE)
   ~^

tests/testthat/test-mapReduce.R:23:4: style: Commented code should be removed.

#expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:27:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:28:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:31:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:35:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:36:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:37:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:38:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:42:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:44:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:46:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:47:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(biomass))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:49:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:50:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:51:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:52:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:56:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:57:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:60:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:64:5: style: Commented code should be removed.

#   ras <- raster(extent(0, 15, 0, 15), res = 1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:65:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes = 5, speedup = 1, p = 0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:67:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:71:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu = 4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:73:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:75:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:76:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:77:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:81:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:82:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:85:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:89:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:90:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:91:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:92:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:96:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:98:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R💯5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:101:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:102:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:4:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:5:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:10:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:13:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:33:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:34:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:39:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:42:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:52:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:55:1: style: Lines should not be more than 100 characters.

​test_that("mergeRaster will use mosaic with default mean if rasters are resampled and fun if passed", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:58:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:59:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:64:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:67:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-randomPolygon.R:24:60: style: Put spaces around all infix operators.

​  expect_true(base::abs(base::abs(polyArea - area)) <  area/4) ## TODO: why is this area/4?
                                                          ~^~

tests/testthat/test-randomPolygon.R:28:3: style: Variable or function name should be lowerCamelCase.

centerSP_UTM <- sp::spTransform(centerSP, CRSobj = raster::crs(poly1InUTM))
  ^~~~~~~~~~~~

tests/testthat/test-randomPolygon.R:30:1: style: Lines should not be more than 100 characters.

​  expect_true(raster::pointDistance(centerSP_UTM, polyCenter, lonlat = FALSE) < 100) ## TODO: appropriate test?
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:148:38: style: Commas should always have a space after.

​  expect_identical(dataType(y4[[1]]),"INT1U")
                                     ^

tests/testthat/test-splitRaster.R:165:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-parallel") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:168:8: style: Commented code should be removed.

#detach("package:raster")
       ^~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:226:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-large") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:264:4: style: Commented code should be removed.

#expect_equal(min(values(m)), min(values(r))) ## Error: cannot allocate vector of size 4.8 Gb
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:283:4: style: Commented code should be removed.

#expect_equal(max(values(m1)), max(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:284:4: style: Commented code should be removed.

#expect_equal(min(values(m1)), min(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread.R:209:1: style: Lines should not be more than 100 characters.

if (interactive()) Plot(circEdge, addTo = "circs", cols = c("transparent", rainbow(numCircs)[whCirc]))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:148:4: style: Commented code should be removed.

#quickDT <- data.table(id = seq_along(sams), initialPixels = sams, key = "id")
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:150:4: style: Commented code should be removed.

#cirOut <- quickDT[cirOut, on = ]
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:473:1: style: Lines should not be more than 100 characters.

##                                    expr       min        lq      mean   median        uq       max neval
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:474:1: style: Lines should not be more than 100 characters.

##         iterativeFun(ras, FALSE, n, sp)  3.096979 12.642477  73.02248 35.17520  91.10528  764.4073   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:475:1: style: Lines should not be more than 100 characters.

##      nonIterativeFun(ras, FALSE, n, sp)  1.509484  6.555565  31.18444 14.91066  42.78317  158.5237   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:476:1: style: Lines should not be more than 100 characters.

##           origSpread(ras, FALSE, n, sp)  5.154006  7.555631  14.87158 11.49005  17.50599  231.5487   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:477:1: style: Lines should not be more than 100 characters.

## origSpreadIterations(ras, FALSE, n, sp) 10.754669 51.524368 141.48620 93.61996 169.10808 2110.2683   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:688:38: style: Place a space before left parenthesis, except in a function call.

ciCentre[seq_len(ncell(ciCentre))[-(ncell(ciCentre) / 2 - ncol(ciCentre) / 2)]] <- NA_integer_
                                     ^

tests/testthat/test-spread2.R:884:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:886:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0.8, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:891:3: style: Variable or function name should be lowerCamelCase.

M <- matrix(0.8, nrow = 50, ncol = 50)
  ^

tests/testthat/test-spread2.R:898:35: style: Put spaces around all infix operators.

start <- c(50, length(landscape)-49)
                                 ~^~

tests/testthat/test-spread2.R:902:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = persistRas, iterations = 10, directions = 8L,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:916:14: style: Use <-, not =, for assignment.

spreadProb = landscape
             ^

tests/testthat/test-spread2.R:918:72: style: Commas should always have a space after.

​  expect_silent(spread2(landscape = landscape, spreadProb = spreadProb,start = start,
                                                                       ^
@lintr-bot

This comment was marked as off-topic.

Copy link

lintr-bot commented on 8f4b70a Jan 9, 2019

inst/examples/example_distanceFromEachPoint.R:37:2: style: Commented code should be removed.

#beginCluster(3) # can do parallel
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/examples/example_distanceFromEachPoint.R:40:2: style: Commented code should be removed.

#endCluster() # if beginCluster was run
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:83:11: style: Do not place spaces around code in parentheses or square brackets.

if ( method != "RMexp") {
          ^

R/initialize.R:88:1: style: Lines should not be more than 100 characters.

map <- raster(RandomFields::RFsimulate(model, y = 1:ncSpeedup, x = 1:nrSpeedup, grid = TRUE, ...))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:223:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPoints <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:247:4: style: Commented code should be removed.

#y <- spTransform(x, areaCRS)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:263:3: style: Variable or function name should be lowerCamelCase.

X <- c(jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxX - minX) + minX)),
  ^

R/initialize.R:265:3: style: Variable or function name should be lowerCamelCase.

Y <- c(jitter(sort(rbeta(nPoints / 2, betaPar, betaPar) * (maxY - meanY) + meanY)),
  ^

R/initialize.R:269:3: style: Variable or function name should be lowerCamelCase.

Sr1 <- Polygon(cbind(X + xAdd, Y + yAdd))
  ^~~

R/initialize.R:270:3: style: Variable or function name should be lowerCamelCase.

Srs1 <- Polygons(list(Sr1), "s1")
  ^~~~

R/initialize.R:283:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.matrix <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~

R/initialize.R:300:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPolygons <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

while(need) {
       ^

R/initialize.R:407:3: style: Commented code should be removed.

# ### INCORPORATE RELEVANT PARTS OF THIS OLD INIT FUNCTION INTO INITCOORDS()
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:412:3: style: Commented code should be removed.

# #'                      (currently only \code{RasterLayer} or
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:413:3: style: Commented code should be removed.

# #'                      \code{SpatialPolygonsDataFrame}) accepted.
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:423:7: style: Commented code should be removed.

#     ext <- extent(agentlocation)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:425:9: style: Commented code should be removed.

#       #            nonNAs <- !is.na(getvalue(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:426:9: style: Commented code should be removed.

#       nonNAs <- !is.na(getValues(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:427:9: style: Commented code should be removed.

#       wh.nonNAs <- which(nonNAs)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:428:9: style: Commented code should be removed.

#       #            ProbInit.v <- cumsum(getvalue(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:429:9: style: Commented code should be removed.

#       ProbInit.v <- cumsum(getValues(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:431:11: style: Commented code should be removed.

#         ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:432:11: style: Commented code should be removed.

#         fI <- findInterval(ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:433:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[fI]
          ^~~~~~~~~~~~~~~~~~~~

R/initialize.R:434:11: style: Commented code should be removed.

#         last.ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:435:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:436:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:438:11: style: Commented code should be removed.

#         #                va <- getvalue(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:439:11: style: Commented code should be removed.

#         va <- getValues(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:440:11: style: Commented code should be removed.

#         ran <- runif(length(va), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:441:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:443:11: style: Commented code should be removed.

#         last.ran <- runif(length(fI2), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:444:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v) + 1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:445:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:447:11: style: Commented code should be removed.

#         #                last.ran <- runif(length(fI2),0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:448:11: style: Commented code should be removed.

#         #                last.fI2 <- wh.nonNAs[last.ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:451:11: style: Commented code should be removed.

#         position <- xyFromCell(agentlocation,fI2,spatial = TRUE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:453:11: style: Commented code should be removed.

#         position <- coordinates(agentlocation)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:455:11: style: Commented code should be removed.

#         stop("need raster layer or Spatial Points object")
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:457:9: style: Commented code should be removed.

#       numagents <- length(position)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:465:13: style: Commented code should be removed.

#           colnames(xy) = c("x", "y")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:466:13: style: Commented code should be removed.

#           position <- SpatialPoints(xy)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:467:13: style: Commented code should be removed.

#           position <- SpatialPoints(sampleRandom(agentlocation, numagents, xy = TRUE, sp = TRUE))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:469:13: style: Commented code should be removed.

#           sam <- sample(1:length(agentlocation),numagents)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:470:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation[sam,])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:472:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:479:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:481:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:483:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:491:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:495:7: style: Commented code should be removed.

#     stop("Need to provide agentlocation, which can be a map layer")
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:497:5: style: Commented code should be removed.

#   heading1 <- runif(numagents, 0, 360)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:498:5: style: Commented code should be removed.

#   distance <- runif(numagents, 0.1, 10)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:500:5: style: Commented code should be removed.

#   .Object@ID <- as.character(1:numagents)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:501:5: style: Commented code should be removed.

#   .Object@spatial <- position
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:502:5: style: Commented code should be removed.

#   .Object@heading <- heading1
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:503:5: style: Commented code should be removed.

#   .Object@distance <- distance
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:505:5: style: Commented code should be removed.

#   return(.Object)
    ^~~~~~~~~~~~~~~

R/initialize.R:510:32: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                               ^

R/initialize.R:510:37: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                    ^

R/initialize.R:510:52: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                   ^

R/initialize.R:510:55: style: Put spaces around all infix operators.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                     ~^~

R/initialize.R:510:56: style: Only use double-quotes.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                       ^~

R/initialize.R:514:22: style: Put spaces around all infix operators.

​  (floor((long + 180)/6) %% 60) + 1
                    ~^~

R/mapReduce.R:53:3: style: Variable or function name should be lowerCamelCase.

BsumVec <- reduced[fullRasterVals] # join
  ^~~~~~~

R/neighbourhood.R:114:21: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                    ^~~~~~~~~~~~~~

R/neighbourhood.R:114:45: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                                            ^~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:233:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:238:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:297:1: style: Lines should not be more than 100 characters.

​              ((from %% numCol + to %% numCol) == 1))# | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:806:29: style: Variable or function name should be lowerCamelCase.

setGeneric("wrap", function(X, bounds, withHeading) {
                            ^

R/neighbourhood.R:815:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:832:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:842:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:843:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:852:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:853:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:862:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:865:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
      ^

R/neighbourhood.R:877:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:902:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:903:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:912:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:915:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:1052:40: style: Commas should always have a space after.

cc <- cbind(pureCircle2[, "x"] - xy[,"x"], pureCircle2[, "y"] - xy[, "y"])
                                       ^

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

1 / sqrt(var * 2 * pi) * exp(-((theta - mu + 2 * pi * k) ^ 2) / (2 * var))
                                  ^

R/probability.R:44:3: style: Variable or function name should be lowerCamelCase.

Next <- term(theta, mu, var, k)
  ^~~~

R/probability.R:45:3: style: Variable or function name should be lowerCamelCase.

Last <- Next
  ^~~~

R/RcppExports.R:68:20: style: Variable or function name should be lowerCamelCase.

runifC <- function(N) {
                   ^

R/RcppExports.R:71:1: style: Trailing blank lines are superfluous.

^

R/SELES.R:53:23: style: Variable or function name should be lowerCamelCase.

numAgents <- function(N, probInit) {
                      ^

R/splitRaster.R:116:1: style: Lines should not be more than 100 characters.

​      clusterApplyLB(cl = cl, x = seq_along(extents), fun = croppy, e = extents, r = r, path = path, rType = rType)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:538:8: style: Commented code should be removed.

#isNASpreadProb <- is.na(spreadProb[])
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:540:11: style: Commented code should be removed.

#   isNASpreadProb <- is.na(spreadProb[])
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:541:11: style: Commented code should be removed.

#   spreadProb[isNASpreadProb] <- 0L
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:942:41: style: Place a space before left parenthesis, except in a function call.

notDupsEvents <- notDups[-(1:(nrSpreads - nrPotentials))]
                                        ^

R/spread2.R:5:1: style: Lines should not be more than 100 characters.

"quantityAdj", "quantityAdj2", "state", "size", "tooBigByNCells", "V1", "proportion"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:674:12: style: Commented code should be removed.

#pureCircle <- unique(pureCircle)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:759:13: style: Commented code should be removed.

# colnamesDtPot <- colnames(dtPotential)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:760:13: style: Commented code should be removed.

# ll <-  lapply(colnamesDtPot, function(x) dtPotential[[x]][!spreadProbNA])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:761:13: style: Commented code should be removed.

# names(ll) <- colnamesDtPot
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:762:13: style: Commented code should be removed.

# dtPotential <- as.data.table(ll)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:772:1: style: Lines should not be more than 100 characters.

​                                                                   .I[sample.int(length(numNeighs), size = numNeighs, prob = spreadProbRel)],
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:787:7: style: Variable or function name should be lowerCamelCase.

NAaSP <- !is.na(actualSpreadProb)
      ^~~~~

R/spread2.R:789:42: style: Commas should always have a space after.

dtPotential <- dtPotential[NAaSP,]
                                         ^

R/spread2.R:830:1: style: Lines should not be more than 100 characters.

# this is to prevent overlap within an event... in some cases, overlap within event is desired, so skip this block
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:1: style: Lines should not be more than 100 characters.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:10: style: Commented code should be removed.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:6:11: style: Commented code should be removed.

​    cat("#START##############\n", file = tmpExFile, append = FALSE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:17:5: style: Commas should never have a space before.

​  } , add = TRUE)
   ~^

tests/testthat/test-mapReduce.R:23:4: style: Commented code should be removed.

#expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:27:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:28:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:31:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:35:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:36:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:37:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:38:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:42:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:44:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:46:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:47:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(biomass))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:49:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:50:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:51:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:52:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:56:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:57:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:60:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:64:5: style: Commented code should be removed.

#   ras <- raster(extent(0, 15, 0, 15), res = 1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:65:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes = 5, speedup = 1, p = 0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:67:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:71:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu = 4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:73:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:75:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:76:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:77:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:81:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:82:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:85:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:89:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:90:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:91:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:92:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:96:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:98:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R💯5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:101:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:102:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:4:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:5:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:10:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:13:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:33:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:34:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:39:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:42:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:52:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:55:1: style: Lines should not be more than 100 characters.

​test_that("mergeRaster will use mosaic with default mean if rasters are resampled and fun if passed", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:58:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:59:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:64:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:67:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-randomPolygon.R:24:60: style: Put spaces around all infix operators.

​  expect_true(base::abs(base::abs(polyArea - area)) <  area/4) ## TODO: why is this area/4?
                                                          ~^~

tests/testthat/test-randomPolygon.R:28:3: style: Variable or function name should be lowerCamelCase.

centerSP_UTM <- sp::spTransform(centerSP, CRSobj = raster::crs(poly1InUTM))
  ^~~~~~~~~~~~

tests/testthat/test-randomPolygon.R:30:1: style: Lines should not be more than 100 characters.

​  expect_true(raster::pointDistance(centerSP_UTM, polyCenter, lonlat = FALSE) < 100) ## TODO: appropriate test?
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:148:38: style: Commas should always have a space after.

​  expect_identical(dataType(y4[[1]]),"INT1U")
                                     ^

tests/testthat/test-splitRaster.R:165:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-parallel") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:168:8: style: Commented code should be removed.

#detach("package:raster")
       ^~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:226:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-large") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:264:4: style: Commented code should be removed.

#expect_equal(min(values(m)), min(values(r))) ## Error: cannot allocate vector of size 4.8 Gb
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:283:4: style: Commented code should be removed.

#expect_equal(max(values(m1)), max(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:284:4: style: Commented code should be removed.

#expect_equal(min(values(m1)), min(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread.R:209:1: style: Lines should not be more than 100 characters.

if (interactive()) Plot(circEdge, addTo = "circs", cols = c("transparent", rainbow(numCircs)[whCirc]))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:148:4: style: Commented code should be removed.

#quickDT <- data.table(id = seq_along(sams), initialPixels = sams, key = "id")
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:150:4: style: Commented code should be removed.

#cirOut <- quickDT[cirOut, on = ]
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:473:1: style: Lines should not be more than 100 characters.

##                                    expr       min        lq      mean   median        uq       max neval
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:474:1: style: Lines should not be more than 100 characters.

##         iterativeFun(ras, FALSE, n, sp)  3.096979 12.642477  73.02248 35.17520  91.10528  764.4073   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:475:1: style: Lines should not be more than 100 characters.

##      nonIterativeFun(ras, FALSE, n, sp)  1.509484  6.555565  31.18444 14.91066  42.78317  158.5237   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:476:1: style: Lines should not be more than 100 characters.

##           origSpread(ras, FALSE, n, sp)  5.154006  7.555631  14.87158 11.49005  17.50599  231.5487   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:477:1: style: Lines should not be more than 100 characters.

## origSpreadIterations(ras, FALSE, n, sp) 10.754669 51.524368 141.48620 93.61996 169.10808 2110.2683   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:688:38: style: Place a space before left parenthesis, except in a function call.

ciCentre[seq_len(ncell(ciCentre))[-(ncell(ciCentre) / 2 - ncol(ciCentre) / 2)]] <- NA_integer_
                                     ^

tests/testthat/test-spread2.R:884:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:886:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0.8, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:891:3: style: Variable or function name should be lowerCamelCase.

M <- matrix(0.8, nrow = 50, ncol = 50)
  ^

tests/testthat/test-spread2.R:898:35: style: Put spaces around all infix operators.

start <- c(50, length(landscape)-49)
                                 ~^~

tests/testthat/test-spread2.R:902:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = persistRas, iterations = 10, directions = 8L,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:916:14: style: Use <-, not =, for assignment.

spreadProb = landscape
             ^

tests/testthat/test-spread2.R:918:72: style: Commas should always have a space after.

​  expect_silent(spread2(landscape = landscape, spreadProb = spreadProb,start = start,
                                                                       ^
@lintr-bot

This comment was marked as off-topic.

Copy link

lintr-bot commented Jan 9, 2019

inst/examples/example_distanceFromEachPoint.R:37:2: style: Commented code should be removed.

#beginCluster(3) # can do parallel
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/examples/example_distanceFromEachPoint.R:40:2: style: Commented code should be removed.

#endCluster() # if beginCluster was run
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:83:11: style: Do not place spaces around code in parentheses or square brackets.

if ( method != "RMexp") {
          ^

R/initialize.R:88:1: style: Lines should not be more than 100 characters.

map <- raster(RandomFields::RFsimulate(model, y = 1:ncSpeedup, x = 1:nrSpeedup, grid = TRUE, ...))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:223:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPoints <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:247:4: style: Commented code should be removed.

#y <- spTransform(x, areaCRS)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:263:3: style: Variable or function name should be lowerCamelCase.

X <- c(jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxX - minX) + minX)),
  ^

R/initialize.R:265:3: style: Variable or function name should be lowerCamelCase.

Y <- c(jitter(sort(rbeta(nPoints / 2, betaPar, betaPar) * (maxY - meanY) + meanY)),
  ^

R/initialize.R:269:3: style: Variable or function name should be lowerCamelCase.

Sr1 <- Polygon(cbind(X + xAdd, Y + yAdd))
  ^~~

R/initialize.R:270:3: style: Variable or function name should be lowerCamelCase.

Srs1 <- Polygons(list(Sr1), "s1")
  ^~~~

R/initialize.R:283:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.matrix <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~

R/initialize.R:300:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPolygons <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

while(need) {
       ^

R/initialize.R:407:3: style: Commented code should be removed.

# ### INCORPORATE RELEVANT PARTS OF THIS OLD INIT FUNCTION INTO INITCOORDS()
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:412:3: style: Commented code should be removed.

# #'                      (currently only \code{RasterLayer} or
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:413:3: style: Commented code should be removed.

# #'                      \code{SpatialPolygonsDataFrame}) accepted.
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:423:7: style: Commented code should be removed.

#     ext <- extent(agentlocation)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:425:9: style: Commented code should be removed.

#       #            nonNAs <- !is.na(getvalue(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:426:9: style: Commented code should be removed.

#       nonNAs <- !is.na(getValues(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:427:9: style: Commented code should be removed.

#       wh.nonNAs <- which(nonNAs)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:428:9: style: Commented code should be removed.

#       #            ProbInit.v <- cumsum(getvalue(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:429:9: style: Commented code should be removed.

#       ProbInit.v <- cumsum(getValues(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:431:11: style: Commented code should be removed.

#         ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:432:11: style: Commented code should be removed.

#         fI <- findInterval(ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:433:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[fI]
          ^~~~~~~~~~~~~~~~~~~~

R/initialize.R:434:11: style: Commented code should be removed.

#         last.ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:435:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:436:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:438:11: style: Commented code should be removed.

#         #                va <- getvalue(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:439:11: style: Commented code should be removed.

#         va <- getValues(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:440:11: style: Commented code should be removed.

#         ran <- runif(length(va), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:441:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:443:11: style: Commented code should be removed.

#         last.ran <- runif(length(fI2), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:444:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v) + 1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:445:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:447:11: style: Commented code should be removed.

#         #                last.ran <- runif(length(fI2),0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:448:11: style: Commented code should be removed.

#         #                last.fI2 <- wh.nonNAs[last.ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:451:11: style: Commented code should be removed.

#         position <- xyFromCell(agentlocation,fI2,spatial = TRUE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:453:11: style: Commented code should be removed.

#         position <- coordinates(agentlocation)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:455:11: style: Commented code should be removed.

#         stop("need raster layer or Spatial Points object")
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:457:9: style: Commented code should be removed.

#       numagents <- length(position)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:465:13: style: Commented code should be removed.

#           colnames(xy) = c("x", "y")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:466:13: style: Commented code should be removed.

#           position <- SpatialPoints(xy)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:467:13: style: Commented code should be removed.

#           position <- SpatialPoints(sampleRandom(agentlocation, numagents, xy = TRUE, sp = TRUE))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:469:13: style: Commented code should be removed.

#           sam <- sample(1:length(agentlocation),numagents)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:470:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation[sam,])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:472:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:479:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:481:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:483:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:491:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:495:7: style: Commented code should be removed.

#     stop("Need to provide agentlocation, which can be a map layer")
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:497:5: style: Commented code should be removed.

#   heading1 <- runif(numagents, 0, 360)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:498:5: style: Commented code should be removed.

#   distance <- runif(numagents, 0.1, 10)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:500:5: style: Commented code should be removed.

#   .Object@ID <- as.character(1:numagents)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:501:5: style: Commented code should be removed.

#   .Object@spatial <- position
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:502:5: style: Commented code should be removed.

#   .Object@heading <- heading1
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:503:5: style: Commented code should be removed.

#   .Object@distance <- distance
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:505:5: style: Commented code should be removed.

#   return(.Object)
    ^~~~~~~~~~~~~~~

R/initialize.R:510:32: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                               ^

R/initialize.R:510:37: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                    ^

R/initialize.R:510:52: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                   ^

R/initialize.R:510:55: style: Put spaces around all infix operators.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                     ~^~

R/initialize.R:510:56: style: Only use double-quotes.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                       ^~

R/initialize.R:514:22: style: Put spaces around all infix operators.

​  (floor((long + 180)/6) %% 60) + 1
                    ~^~

R/mapReduce.R:53:3: style: Variable or function name should be lowerCamelCase.

BsumVec <- reduced[fullRasterVals] # join
  ^~~~~~~

R/neighbourhood.R:114:21: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                    ^~~~~~~~~~~~~~

R/neighbourhood.R:114:45: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                                            ^~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:233:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:238:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:297:1: style: Lines should not be more than 100 characters.

​              ((from %% numCol + to %% numCol) == 1))# | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:806:29: style: Variable or function name should be lowerCamelCase.

setGeneric("wrap", function(X, bounds, withHeading) {
                            ^

R/neighbourhood.R:815:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:832:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:842:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:843:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:852:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:853:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:862:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:865:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
      ^

R/neighbourhood.R:877:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:902:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:903:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:912:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:915:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:1052:40: style: Commas should always have a space after.

cc <- cbind(pureCircle2[, "x"] - xy[,"x"], pureCircle2[, "y"] - xy[, "y"])
                                       ^

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

1 / sqrt(var * 2 * pi) * exp(-((theta - mu + 2 * pi * k) ^ 2) / (2 * var))
                                  ^

R/probability.R:44:3: style: Variable or function name should be lowerCamelCase.

Next <- term(theta, mu, var, k)
  ^~~~

R/probability.R:45:3: style: Variable or function name should be lowerCamelCase.

Last <- Next
  ^~~~

R/RcppExports.R:68:20: style: Variable or function name should be lowerCamelCase.

runifC <- function(N) {
                   ^

R/RcppExports.R:71:1: style: Trailing blank lines are superfluous.

^

R/SELES.R:53:23: style: Variable or function name should be lowerCamelCase.

numAgents <- function(N, probInit) {
                      ^

R/splitRaster.R:116:1: style: Lines should not be more than 100 characters.

​      clusterApplyLB(cl = cl, x = seq_along(extents), fun = croppy, e = extents, r = r, path = path, rType = rType)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:538:8: style: Commented code should be removed.

#isNASpreadProb <- is.na(spreadProb[])
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:540:11: style: Commented code should be removed.

#   isNASpreadProb <- is.na(spreadProb[])
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:541:11: style: Commented code should be removed.

#   spreadProb[isNASpreadProb] <- 0L
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:942:41: style: Place a space before left parenthesis, except in a function call.

notDupsEvents <- notDups[-(1:(nrSpreads - nrPotentials))]
                                        ^

R/spread2.R:5:1: style: Lines should not be more than 100 characters.

"quantityAdj", "quantityAdj2", "state", "size", "tooBigByNCells", "V1", "proportion"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:674:12: style: Commented code should be removed.

#pureCircle <- unique(pureCircle)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:759:13: style: Commented code should be removed.

# colnamesDtPot <- colnames(dtPotential)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:760:13: style: Commented code should be removed.

# ll <-  lapply(colnamesDtPot, function(x) dtPotential[[x]][!spreadProbNA])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:761:13: style: Commented code should be removed.

# names(ll) <- colnamesDtPot
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:762:13: style: Commented code should be removed.

# dtPotential <- as.data.table(ll)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:772:1: style: Lines should not be more than 100 characters.

​                                                                   .I[sample.int(length(numNeighs), size = numNeighs, prob = spreadProbRel)],
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:787:7: style: Variable or function name should be lowerCamelCase.

NAaSP <- !is.na(actualSpreadProb)
      ^~~~~

R/spread2.R:789:42: style: Commas should always have a space after.

dtPotential <- dtPotential[NAaSP,]
                                         ^

R/spread2.R:830:1: style: Lines should not be more than 100 characters.

# this is to prevent overlap within an event... in some cases, overlap within event is desired, so skip this block
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:1: style: Lines should not be more than 100 characters.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:10: style: Commented code should be removed.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:6:11: style: Commented code should be removed.

​    cat("#START##############\n", file = tmpExFile, append = FALSE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:17:5: style: Commas should never have a space before.

​  } , add = TRUE)
   ~^

tests/testthat/test-mapReduce.R:23:4: style: Commented code should be removed.

#expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:27:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:28:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:31:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:35:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:36:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:37:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:38:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:42:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:44:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:46:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:47:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(biomass))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:49:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:50:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:51:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:52:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:56:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:57:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:60:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:64:5: style: Commented code should be removed.

#   ras <- raster(extent(0, 15, 0, 15), res = 1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:65:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes = 5, speedup = 1, p = 0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:67:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:71:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu = 4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:73:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:75:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:76:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:77:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:81:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:82:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:85:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:89:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:90:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:91:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:92:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:96:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:98:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R💯5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:101:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:102:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:4:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:5:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:10:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:13:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:33:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:34:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:39:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:42:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:52:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:55:1: style: Lines should not be more than 100 characters.

​test_that("mergeRaster will use mosaic with default mean if rasters are resampled and fun if passed", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:58:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:59:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:64:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:67:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-randomPolygon.R:24:60: style: Put spaces around all infix operators.

​  expect_true(base::abs(base::abs(polyArea - area)) <  area/4) ## TODO: why is this area/4?
                                                          ~^~

tests/testthat/test-randomPolygon.R:28:3: style: Variable or function name should be lowerCamelCase.

centerSP_UTM <- sp::spTransform(centerSP, CRSobj = raster::crs(poly1InUTM))
  ^~~~~~~~~~~~

tests/testthat/test-randomPolygon.R:30:1: style: Lines should not be more than 100 characters.

​  expect_true(raster::pointDistance(centerSP_UTM, polyCenter, lonlat = FALSE) < 100) ## TODO: appropriate test?
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:148:38: style: Commas should always have a space after.

​  expect_identical(dataType(y4[[1]]),"INT1U")
                                     ^

tests/testthat/test-splitRaster.R:165:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-parallel") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:168:8: style: Commented code should be removed.

#detach("package:raster")
       ^~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:226:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-large") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:264:4: style: Commented code should be removed.

#expect_equal(min(values(m)), min(values(r))) ## Error: cannot allocate vector of size 4.8 Gb
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:283:4: style: Commented code should be removed.

#expect_equal(max(values(m1)), max(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:284:4: style: Commented code should be removed.

#expect_equal(min(values(m1)), min(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread.R:209:1: style: Lines should not be more than 100 characters.

if (interactive()) Plot(circEdge, addTo = "circs", cols = c("transparent", rainbow(numCircs)[whCirc]))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:148:4: style: Commented code should be removed.

#quickDT <- data.table(id = seq_along(sams), initialPixels = sams, key = "id")
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:150:4: style: Commented code should be removed.

#cirOut <- quickDT[cirOut, on = ]
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:473:1: style: Lines should not be more than 100 characters.

##                                    expr       min        lq      mean   median        uq       max neval
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:474:1: style: Lines should not be more than 100 characters.

##         iterativeFun(ras, FALSE, n, sp)  3.096979 12.642477  73.02248 35.17520  91.10528  764.4073   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:475:1: style: Lines should not be more than 100 characters.

##      nonIterativeFun(ras, FALSE, n, sp)  1.509484  6.555565  31.18444 14.91066  42.78317  158.5237   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:476:1: style: Lines should not be more than 100 characters.

##           origSpread(ras, FALSE, n, sp)  5.154006  7.555631  14.87158 11.49005  17.50599  231.5487   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:477:1: style: Lines should not be more than 100 characters.

## origSpreadIterations(ras, FALSE, n, sp) 10.754669 51.524368 141.48620 93.61996 169.10808 2110.2683   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:688:38: style: Place a space before left parenthesis, except in a function call.

ciCentre[seq_len(ncell(ciCentre))[-(ncell(ciCentre) / 2 - ncol(ciCentre) / 2)]] <- NA_integer_
                                     ^

tests/testthat/test-spread2.R:884:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:886:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0.8, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:891:3: style: Variable or function name should be lowerCamelCase.

M <- matrix(0.8, nrow = 50, ncol = 50)
  ^

tests/testthat/test-spread2.R:898:35: style: Put spaces around all infix operators.

start <- c(50, length(landscape)-49)
                                 ~^~

tests/testthat/test-spread2.R:902:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = persistRas, iterations = 10, directions = 8L,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:916:14: style: Use <-, not =, for assignment.

spreadProb = landscape
             ^

tests/testthat/test-spread2.R:918:72: style: Commas should always have a space after.

​  expect_silent(spread2(landscape = landscape, spreadProb = spreadProb,start = start,
                                                                       ^
@lintr-bot

This comment has been minimized.

Copy link

lintr-bot commented Jan 23, 2019

inst/examples/example_distanceFromEachPoint.R:37:2: style: Commented code should be removed.

#beginCluster(3) # can do parallel
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/examples/example_distanceFromEachPoint.R:40:2: style: Commented code should be removed.

#endCluster() # if beginCluster was run
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:83:11: style: Do not place spaces around code in parentheses or square brackets.

if ( method != "RMexp") {
          ^

R/initialize.R:88:1: style: Lines should not be more than 100 characters.

map <- raster(RandomFields::RFsimulate(model, y = 1:ncSpeedup, x = 1:nrSpeedup, grid = TRUE, ...))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:223:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPoints <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:247:4: style: Commented code should be removed.

#y <- spTransform(x, areaCRS)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:263:3: style: Variable or function name should be lowerCamelCase.

X <- c(jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxX - minX) + minX)),
  ^

R/initialize.R:265:3: style: Variable or function name should be lowerCamelCase.

Y <- c(jitter(sort(rbeta(nPoints / 2, betaPar, betaPar) * (maxY - meanY) + meanY)),
  ^

R/initialize.R:269:3: style: Variable or function name should be lowerCamelCase.

Sr1 <- Polygon(cbind(X + xAdd, Y + yAdd))
  ^~~

R/initialize.R:270:3: style: Variable or function name should be lowerCamelCase.

Srs1 <- Polygons(list(Sr1), "s1")
  ^~~~

R/initialize.R:283:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.matrix <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~

R/initialize.R:300:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPolygons <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

while(need) {
       ^

R/initialize.R:407:3: style: Commented code should be removed.

# ### INCORPORATE RELEVANT PARTS OF THIS OLD INIT FUNCTION INTO INITCOORDS()
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:412:3: style: Commented code should be removed.

# #'                      (currently only \code{RasterLayer} or
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:413:3: style: Commented code should be removed.

# #'                      \code{SpatialPolygonsDataFrame}) accepted.
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:423:7: style: Commented code should be removed.

#     ext <- extent(agentlocation)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:425:9: style: Commented code should be removed.

#       #            nonNAs <- !is.na(getvalue(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:426:9: style: Commented code should be removed.

#       nonNAs <- !is.na(getValues(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:427:9: style: Commented code should be removed.

#       wh.nonNAs <- which(nonNAs)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:428:9: style: Commented code should be removed.

#       #            ProbInit.v <- cumsum(getvalue(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:429:9: style: Commented code should be removed.

#       ProbInit.v <- cumsum(getValues(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:431:11: style: Commented code should be removed.

#         ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:432:11: style: Commented code should be removed.

#         fI <- findInterval(ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:433:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[fI]
          ^~~~~~~~~~~~~~~~~~~~

R/initialize.R:434:11: style: Commented code should be removed.

#         last.ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:435:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:436:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:438:11: style: Commented code should be removed.

#         #                va <- getvalue(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:439:11: style: Commented code should be removed.

#         va <- getValues(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:440:11: style: Commented code should be removed.

#         ran <- runif(length(va), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:441:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:443:11: style: Commented code should be removed.

#         last.ran <- runif(length(fI2), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:444:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v) + 1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:445:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:447:11: style: Commented code should be removed.

#         #                last.ran <- runif(length(fI2),0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:448:11: style: Commented code should be removed.

#         #                last.fI2 <- wh.nonNAs[last.ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:451:11: style: Commented code should be removed.

#         position <- xyFromCell(agentlocation,fI2,spatial = TRUE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:453:11: style: Commented code should be removed.

#         position <- coordinates(agentlocation)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:455:11: style: Commented code should be removed.

#         stop("need raster layer or Spatial Points object")
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:457:9: style: Commented code should be removed.

#       numagents <- length(position)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:465:13: style: Commented code should be removed.

#           colnames(xy) = c("x", "y")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:466:13: style: Commented code should be removed.

#           position <- SpatialPoints(xy)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:467:13: style: Commented code should be removed.

#           position <- SpatialPoints(sampleRandom(agentlocation, numagents, xy = TRUE, sp = TRUE))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:469:13: style: Commented code should be removed.

#           sam <- sample(1:length(agentlocation),numagents)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:470:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation[sam,])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:472:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:479:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:481:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:483:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:491:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:495:7: style: Commented code should be removed.

#     stop("Need to provide agentlocation, which can be a map layer")
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:497:5: style: Commented code should be removed.

#   heading1 <- runif(numagents, 0, 360)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:498:5: style: Commented code should be removed.

#   distance <- runif(numagents, 0.1, 10)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:500:5: style: Commented code should be removed.

#   .Object@ID <- as.character(1:numagents)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:501:5: style: Commented code should be removed.

#   .Object@spatial <- position
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:502:5: style: Commented code should be removed.

#   .Object@heading <- heading1
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:503:5: style: Commented code should be removed.

#   .Object@distance <- distance
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:505:5: style: Commented code should be removed.

#   return(.Object)
    ^~~~~~~~~~~~~~~

R/initialize.R:510:32: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                               ^

R/initialize.R:510:37: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                    ^

R/initialize.R:510:52: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                   ^

R/initialize.R:510:55: style: Put spaces around all infix operators.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                     ~^~

R/initialize.R:510:56: style: Only use double-quotes.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                       ^~

R/initialize.R:514:22: style: Put spaces around all infix operators.

​  (floor((long + 180)/6) %% 60) + 1
                    ~^~

R/mapReduce.R:53:3: style: Variable or function name should be lowerCamelCase.

BsumVec <- reduced[fullRasterVals] # join
  ^~~~~~~

R/neighbourhood.R:114:21: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                    ^~~~~~~~~~~~~~

R/neighbourhood.R:114:45: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                                            ^~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:233:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:238:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:297:1: style: Lines should not be more than 100 characters.

​              ((from %% numCol + to %% numCol) == 1))# | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:806:29: style: Variable or function name should be lowerCamelCase.

setGeneric("wrap", function(X, bounds, withHeading) {
                            ^

R/neighbourhood.R:815:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:832:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:842:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:843:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:852:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:853:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:862:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:865:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
      ^

R/neighbourhood.R:877:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:902:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:903:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:912:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:915:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:1052:40: style: Commas should always have a space after.

cc <- cbind(pureCircle2[, "x"] - xy[,"x"], pureCircle2[, "y"] - xy[, "y"])
                                       ^

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

1 / sqrt(var * 2 * pi) * exp(-((theta - mu + 2 * pi * k) ^ 2) / (2 * var))
                                  ^

R/probability.R:44:3: style: Variable or function name should be lowerCamelCase.

Next <- term(theta, mu, var, k)
  ^~~~

R/probability.R:45:3: style: Variable or function name should be lowerCamelCase.

Last <- Next
  ^~~~

R/RcppExports.R:68:20: style: Variable or function name should be lowerCamelCase.

runifC <- function(N) {
                   ^

R/RcppExports.R:71:1: style: Trailing blank lines are superfluous.

^

R/SELES.R:53:23: style: Variable or function name should be lowerCamelCase.

numAgents <- function(N, probInit) {
                      ^

R/splitRaster.R:116:1: style: Lines should not be more than 100 characters.

​      clusterApplyLB(cl = cl, x = seq_along(extents), fun = croppy, e = extents, r = r, path = path, rType = rType)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:538:8: style: Commented code should be removed.

#isNASpreadProb <- is.na(spreadProb[])
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:540:11: style: Commented code should be removed.

#   isNASpreadProb <- is.na(spreadProb[])
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:541:11: style: Commented code should be removed.

#   spreadProb[isNASpreadProb] <- 0L
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:942:41: style: Place a space before left parenthesis, except in a function call.

notDupsEvents <- notDups[-(1:(nrSpreads - nrPotentials))]
                                        ^

R/spread2.R:5:1: style: Lines should not be more than 100 characters.

"quantityAdj", "quantityAdj2", "state", "size", "tooBigByNCells", "V1", "proportion"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:674:12: style: Commented code should be removed.

#pureCircle <- unique(pureCircle)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:759:13: style: Commented code should be removed.

# colnamesDtPot <- colnames(dtPotential)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:760:13: style: Commented code should be removed.

# ll <-  lapply(colnamesDtPot, function(x) dtPotential[[x]][!spreadProbNA])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:761:13: style: Commented code should be removed.

# names(ll) <- colnamesDtPot
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:762:13: style: Commented code should be removed.

# dtPotential <- as.data.table(ll)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:772:1: style: Lines should not be more than 100 characters.

​                                                                   .I[sample.int(length(numNeighs), size = numNeighs, prob = spreadProbRel)],
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:787:7: style: Variable or function name should be lowerCamelCase.

NAaSP <- !is.na(actualSpreadProb)
      ^~~~~

R/spread2.R:789:42: style: Commas should always have a space after.

dtPotential <- dtPotential[NAaSP,]
                                         ^

R/spread2.R:830:1: style: Lines should not be more than 100 characters.

# this is to prevent overlap within an event... in some cases, overlap within event is desired, so skip this block
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:1: style: Lines should not be more than 100 characters.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:10: style: Commented code should be removed.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:6:11: style: Commented code should be removed.

​    cat("#START##############\n", file = tmpExFile, append = FALSE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:17:5: style: Commas should never have a space before.

​  } , add = TRUE)
   ~^

tests/testthat/test-mapReduce.R:23:4: style: Commented code should be removed.

#expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:27:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:28:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:31:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:35:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:36:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:37:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:38:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:42:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:44:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:46:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:47:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(biomass))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:49:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:50:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:51:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:52:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:56:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:57:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:60:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:64:5: style: Commented code should be removed.

#   ras <- raster(extent(0, 15, 0, 15), res = 1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:65:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes = 5, speedup = 1, p = 0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:67:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:71:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu = 4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:73:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:75:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:76:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:77:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:81:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:82:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:85:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:89:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:90:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:91:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:92:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:96:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:98:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R💯5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:101:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:102:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:4:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:5:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:10:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:13:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:33:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:34:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:39:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:42:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:52:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:55:1: style: Lines should not be more than 100 characters.

​test_that("mergeRaster will use mosaic with default mean if rasters are resampled and fun if passed", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:58:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:59:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:64:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:67:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-randomPolygon.R:24:60: style: Put spaces around all infix operators.

​  expect_true(base::abs(base::abs(polyArea - area)) <  area/4) ## TODO: why is this area/4?
                                                          ~^~

tests/testthat/test-randomPolygon.R:28:3: style: Variable or function name should be lowerCamelCase.

centerSP_UTM <- sp::spTransform(centerSP, CRSobj = raster::crs(poly1InUTM))
  ^~~~~~~~~~~~

tests/testthat/test-randomPolygon.R:30:1: style: Lines should not be more than 100 characters.

​  expect_true(raster::pointDistance(centerSP_UTM, polyCenter, lonlat = FALSE) < 100) ## TODO: appropriate test?
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:148:38: style: Commas should always have a space after.

​  expect_identical(dataType(y4[[1]]),"INT1U")
                                     ^

tests/testthat/test-splitRaster.R:165:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-parallel") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:168:8: style: Commented code should be removed.

#detach("package:raster")
       ^~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:226:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-large") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:264:4: style: Commented code should be removed.

#expect_equal(min(values(m)), min(values(r))) ## Error: cannot allocate vector of size 4.8 Gb
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:283:4: style: Commented code should be removed.

#expect_equal(max(values(m1)), max(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:284:4: style: Commented code should be removed.

#expect_equal(min(values(m1)), min(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread.R:209:1: style: Lines should not be more than 100 characters.

if (interactive()) Plot(circEdge, addTo = "circs", cols = c("transparent", rainbow(numCircs)[whCirc]))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:148:4: style: Commented code should be removed.

#quickDT <- data.table(id = seq_along(sams), initialPixels = sams, key = "id")
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:150:4: style: Commented code should be removed.

#cirOut <- quickDT[cirOut, on = ]
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:473:1: style: Lines should not be more than 100 characters.

##                                    expr       min        lq      mean   median        uq       max neval
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:474:1: style: Lines should not be more than 100 characters.

##         iterativeFun(ras, FALSE, n, sp)  3.096979 12.642477  73.02248 35.17520  91.10528  764.4073   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:475:1: style: Lines should not be more than 100 characters.

##      nonIterativeFun(ras, FALSE, n, sp)  1.509484  6.555565  31.18444 14.91066  42.78317  158.5237   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:476:1: style: Lines should not be more than 100 characters.

##           origSpread(ras, FALSE, n, sp)  5.154006  7.555631  14.87158 11.49005  17.50599  231.5487   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:477:1: style: Lines should not be more than 100 characters.

## origSpreadIterations(ras, FALSE, n, sp) 10.754669 51.524368 141.48620 93.61996 169.10808 2110.2683   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:688:38: style: Place a space before left parenthesis, except in a function call.

ciCentre[seq_len(ncell(ciCentre))[-(ncell(ciCentre) / 2 - ncol(ciCentre) / 2)]] <- NA_integer_
                                     ^

tests/testthat/test-spread2.R:884:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:886:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0.8, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:891:3: style: Variable or function name should be lowerCamelCase.

M <- matrix(0.8, nrow = 50, ncol = 50)
  ^

tests/testthat/test-spread2.R:898:35: style: Put spaces around all infix operators.

start <- c(50, length(landscape)-49)
                                 ~^~

tests/testthat/test-spread2.R:902:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = persistRas, iterations = 10, directions = 8L,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:916:14: style: Use <-, not =, for assignment.

spreadProb = landscape
             ^

tests/testthat/test-spread2.R:918:72: style: Commas should always have a space after.

​  expect_silent(spread2(landscape = landscape, spreadProb = spreadProb,start = start,
                                                                       ^
@lintr-bot

This comment has been minimized.

Copy link

lintr-bot commented on e9c1a28 Jan 23, 2019

inst/examples/example_distanceFromEachPoint.R:37:2: style: Commented code should be removed.

#beginCluster(3) # can do parallel
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/examples/example_distanceFromEachPoint.R:40:2: style: Commented code should be removed.

#endCluster() # if beginCluster was run
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:83:11: style: Do not place spaces around code in parentheses or square brackets.

if ( method != "RMexp") {
          ^

R/initialize.R:88:1: style: Lines should not be more than 100 characters.

map <- raster(RandomFields::RFsimulate(model, y = 1:ncSpeedup, x = 1:nrSpeedup, grid = TRUE, ...))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:223:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPoints <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:247:4: style: Commented code should be removed.

#y <- spTransform(x, areaCRS)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:263:3: style: Variable or function name should be lowerCamelCase.

X <- c(jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxX - minX) + minX)),
  ^

R/initialize.R:265:3: style: Variable or function name should be lowerCamelCase.

Y <- c(jitter(sort(rbeta(nPoints / 2, betaPar, betaPar) * (maxY - meanY) + meanY)),
  ^

R/initialize.R:269:3: style: Variable or function name should be lowerCamelCase.

Sr1 <- Polygon(cbind(X + xAdd, Y + yAdd))
  ^~~

R/initialize.R:270:3: style: Variable or function name should be lowerCamelCase.

Srs1 <- Polygons(list(Sr1), "s1")
  ^~~~

R/initialize.R:283:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.matrix <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~

R/initialize.R:300:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPolygons <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

while(need) {
       ^

R/initialize.R:407:3: style: Commented code should be removed.

# ### INCORPORATE RELEVANT PARTS OF THIS OLD INIT FUNCTION INTO INITCOORDS()
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:412:3: style: Commented code should be removed.

# #'                      (currently only \code{RasterLayer} or
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:413:3: style: Commented code should be removed.

# #'                      \code{SpatialPolygonsDataFrame}) accepted.
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:423:7: style: Commented code should be removed.

#     ext <- extent(agentlocation)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:425:9: style: Commented code should be removed.

#       #            nonNAs <- !is.na(getvalue(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:426:9: style: Commented code should be removed.

#       nonNAs <- !is.na(getValues(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:427:9: style: Commented code should be removed.

#       wh.nonNAs <- which(nonNAs)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:428:9: style: Commented code should be removed.

#       #            ProbInit.v <- cumsum(getvalue(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:429:9: style: Commented code should be removed.

#       ProbInit.v <- cumsum(getValues(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:431:11: style: Commented code should be removed.

#         ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:432:11: style: Commented code should be removed.

#         fI <- findInterval(ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:433:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[fI]
          ^~~~~~~~~~~~~~~~~~~~

R/initialize.R:434:11: style: Commented code should be removed.

#         last.ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:435:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:436:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:438:11: style: Commented code should be removed.

#         #                va <- getvalue(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:439:11: style: Commented code should be removed.

#         va <- getValues(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:440:11: style: Commented code should be removed.

#         ran <- runif(length(va), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:441:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:443:11: style: Commented code should be removed.

#         last.ran <- runif(length(fI2), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:444:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v) + 1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:445:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:447:11: style: Commented code should be removed.

#         #                last.ran <- runif(length(fI2),0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:448:11: style: Commented code should be removed.

#         #                last.fI2 <- wh.nonNAs[last.ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:451:11: style: Commented code should be removed.

#         position <- xyFromCell(agentlocation,fI2,spatial = TRUE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:453:11: style: Commented code should be removed.

#         position <- coordinates(agentlocation)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:455:11: style: Commented code should be removed.

#         stop("need raster layer or Spatial Points object")
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:457:9: style: Commented code should be removed.

#       numagents <- length(position)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:465:13: style: Commented code should be removed.

#           colnames(xy) = c("x", "y")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:466:13: style: Commented code should be removed.

#           position <- SpatialPoints(xy)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:467:13: style: Commented code should be removed.

#           position <- SpatialPoints(sampleRandom(agentlocation, numagents, xy = TRUE, sp = TRUE))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:469:13: style: Commented code should be removed.

#           sam <- sample(1:length(agentlocation),numagents)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:470:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation[sam,])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:472:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:479:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:481:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:483:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:491:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:495:7: style: Commented code should be removed.

#     stop("Need to provide agentlocation, which can be a map layer")
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:497:5: style: Commented code should be removed.

#   heading1 <- runif(numagents, 0, 360)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:498:5: style: Commented code should be removed.

#   distance <- runif(numagents, 0.1, 10)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:500:5: style: Commented code should be removed.

#   .Object@ID <- as.character(1:numagents)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:501:5: style: Commented code should be removed.

#   .Object@spatial <- position
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:502:5: style: Commented code should be removed.

#   .Object@heading <- heading1
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:503:5: style: Commented code should be removed.

#   .Object@distance <- distance
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:505:5: style: Commented code should be removed.

#   return(.Object)
    ^~~~~~~~~~~~~~~

R/initialize.R:510:32: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                               ^

R/initialize.R:510:37: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                    ^

R/initialize.R:510:52: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                   ^

R/initialize.R:510:55: style: Put spaces around all infix operators.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                     ~^~

R/initialize.R:510:56: style: Only use double-quotes.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                       ^~

R/initialize.R:514:22: style: Put spaces around all infix operators.

​  (floor((long + 180)/6) %% 60) + 1
                    ~^~

R/mapReduce.R:53:3: style: Variable or function name should be lowerCamelCase.

BsumVec <- reduced[fullRasterVals] # join
  ^~~~~~~

R/neighbourhood.R:114:21: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                    ^~~~~~~~~~~~~~

R/neighbourhood.R:114:45: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                                            ^~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:233:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:238:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:297:1: style: Lines should not be more than 100 characters.

​              ((from %% numCol + to %% numCol) == 1))# | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:806:29: style: Variable or function name should be lowerCamelCase.

setGeneric("wrap", function(X, bounds, withHeading) {
                            ^

R/neighbourhood.R:815:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:832:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:842:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:843:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:852:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:853:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:862:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:865:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
      ^

R/neighbourhood.R:877:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:902:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:903:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:912:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:915:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:1052:40: style: Commas should always have a space after.

cc <- cbind(pureCircle2[, "x"] - xy[,"x"], pureCircle2[, "y"] - xy[, "y"])
                                       ^

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

1 / sqrt(var * 2 * pi) * exp(-((theta - mu + 2 * pi * k) ^ 2) / (2 * var))
                                  ^

R/probability.R:44:3: style: Variable or function name should be lowerCamelCase.

Next <- term(theta, mu, var, k)
  ^~~~

R/probability.R:45:3: style: Variable or function name should be lowerCamelCase.

Last <- Next
  ^~~~

R/RcppExports.R:68:20: style: Variable or function name should be lowerCamelCase.

runifC <- function(N) {
                   ^

R/RcppExports.R:71:1: style: Trailing blank lines are superfluous.

^

R/SELES.R:53:23: style: Variable or function name should be lowerCamelCase.

numAgents <- function(N, probInit) {
                      ^

R/splitRaster.R:116:1: style: Lines should not be more than 100 characters.

​      clusterApplyLB(cl = cl, x = seq_along(extents), fun = croppy, e = extents, r = r, path = path, rType = rType)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:538:8: style: Commented code should be removed.

#isNASpreadProb <- is.na(spreadProb[])
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:540:11: style: Commented code should be removed.

#   isNASpreadProb <- is.na(spreadProb[])
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:541:11: style: Commented code should be removed.

#   spreadProb[isNASpreadProb] <- 0L
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:942:41: style: Place a space before left parenthesis, except in a function call.

notDupsEvents <- notDups[-(1:(nrSpreads - nrPotentials))]
                                        ^

R/spread2.R:5:1: style: Lines should not be more than 100 characters.

"quantityAdj", "quantityAdj2", "state", "size", "tooBigByNCells", "V1", "proportion"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:674:12: style: Commented code should be removed.

#pureCircle <- unique(pureCircle)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:759:13: style: Commented code should be removed.

# colnamesDtPot <- colnames(dtPotential)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:760:13: style: Commented code should be removed.

# ll <-  lapply(colnamesDtPot, function(x) dtPotential[[x]][!spreadProbNA])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:761:13: style: Commented code should be removed.

# names(ll) <- colnamesDtPot
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:762:13: style: Commented code should be removed.

# dtPotential <- as.data.table(ll)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:772:1: style: Lines should not be more than 100 characters.

​                                                                   .I[sample.int(length(numNeighs), size = numNeighs, prob = spreadProbRel)],
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:787:7: style: Variable or function name should be lowerCamelCase.

NAaSP <- !is.na(actualSpreadProb)
      ^~~~~

R/spread2.R:789:42: style: Commas should always have a space after.

dtPotential <- dtPotential[NAaSP,]
                                         ^

R/spread2.R:830:1: style: Lines should not be more than 100 characters.

# this is to prevent overlap within an event... in some cases, overlap within event is desired, so skip this block
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:1: style: Lines should not be more than 100 characters.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:10: style: Commented code should be removed.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:6:11: style: Commented code should be removed.

​    cat("#START##############\n", file = tmpExFile, append = FALSE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:17:5: style: Commas should never have a space before.

​  } , add = TRUE)
   ~^

tests/testthat/test-mapReduce.R:23:4: style: Commented code should be removed.

#expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:27:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:28:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:31:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:35:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:36:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:37:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:38:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:42:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:44:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:46:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:47:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(biomass))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:49:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:50:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:51:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:52:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:56:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:57:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:60:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:64:5: style: Commented code should be removed.

#   ras <- raster(extent(0, 15, 0, 15), res = 1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:65:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes = 5, speedup = 1, p = 0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:67:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:71:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu = 4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:73:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:75:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:76:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:77:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:81:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:82:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:85:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:89:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:90:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:91:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:92:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:96:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:98:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R💯5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:101:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:102:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:4:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:5:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:10:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:13:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:33:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:34:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:39:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:42:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:52:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:55:1: style: Lines should not be more than 100 characters.

​test_that("mergeRaster will use mosaic with default mean if rasters are resampled and fun if passed", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:58:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:59:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:64:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:67:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-randomPolygon.R:24:60: style: Put spaces around all infix operators.

​  expect_true(base::abs(base::abs(polyArea - area)) <  area/4) ## TODO: why is this area/4?
                                                          ~^~

tests/testthat/test-randomPolygon.R:28:3: style: Variable or function name should be lowerCamelCase.

centerSP_UTM <- sp::spTransform(centerSP, CRSobj = raster::crs(poly1InUTM))
  ^~~~~~~~~~~~

tests/testthat/test-randomPolygon.R:30:1: style: Lines should not be more than 100 characters.

​  expect_true(raster::pointDistance(centerSP_UTM, polyCenter, lonlat = FALSE) < 100) ## TODO: appropriate test?
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:148:38: style: Commas should always have a space after.

​  expect_identical(dataType(y4[[1]]),"INT1U")
                                     ^

tests/testthat/test-splitRaster.R:165:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-parallel") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:168:8: style: Commented code should be removed.

#detach("package:raster")
       ^~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:226:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-large") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:264:4: style: Commented code should be removed.

#expect_equal(min(values(m)), min(values(r))) ## Error: cannot allocate vector of size 4.8 Gb
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:283:4: style: Commented code should be removed.

#expect_equal(max(values(m1)), max(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:284:4: style: Commented code should be removed.

#expect_equal(min(values(m1)), min(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread.R:209:1: style: Lines should not be more than 100 characters.

if (interactive()) Plot(circEdge, addTo = "circs", cols = c("transparent", rainbow(numCircs)[whCirc]))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:148:4: style: Commented code should be removed.

#quickDT <- data.table(id = seq_along(sams), initialPixels = sams, key = "id")
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:150:4: style: Commented code should be removed.

#cirOut <- quickDT[cirOut, on = ]
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:473:1: style: Lines should not be more than 100 characters.

##                                    expr       min        lq      mean   median        uq       max neval
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:474:1: style: Lines should not be more than 100 characters.

##         iterativeFun(ras, FALSE, n, sp)  3.096979 12.642477  73.02248 35.17520  91.10528  764.4073   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:475:1: style: Lines should not be more than 100 characters.

##      nonIterativeFun(ras, FALSE, n, sp)  1.509484  6.555565  31.18444 14.91066  42.78317  158.5237   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:476:1: style: Lines should not be more than 100 characters.

##           origSpread(ras, FALSE, n, sp)  5.154006  7.555631  14.87158 11.49005  17.50599  231.5487   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:477:1: style: Lines should not be more than 100 characters.

## origSpreadIterations(ras, FALSE, n, sp) 10.754669 51.524368 141.48620 93.61996 169.10808 2110.2683   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:688:38: style: Place a space before left parenthesis, except in a function call.

ciCentre[seq_len(ncell(ciCentre))[-(ncell(ciCentre) / 2 - ncol(ciCentre) / 2)]] <- NA_integer_
                                     ^

tests/testthat/test-spread2.R:884:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:886:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0.8, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:891:3: style: Variable or function name should be lowerCamelCase.

M <- matrix(0.8, nrow = 50, ncol = 50)
  ^

tests/testthat/test-spread2.R:898:35: style: Put spaces around all infix operators.

start <- c(50, length(landscape)-49)
                                 ~^~

tests/testthat/test-spread2.R:902:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = persistRas, iterations = 10, directions = 8L,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:916:14: style: Use <-, not =, for assignment.

spreadProb = landscape
             ^

tests/testthat/test-spread2.R:918:72: style: Commas should always have a space after.

​  expect_silent(spread2(landscape = landscape, spreadProb = spreadProb,start = start,
                                                                       ^

This comment has been minimized.

Copy link

lintr-bot replied Jan 28, 2019

inst/examples/example_distanceFromEachPoint.R:37:2: style: Commented code should be removed.

#beginCluster(3) # can do parallel
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/examples/example_distanceFromEachPoint.R:40:2: style: Commented code should be removed.

#endCluster() # if beginCluster was run
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:83:11: style: Do not place spaces around code in parentheses or square brackets.

if ( method != "RMexp") {
          ^

R/initialize.R:88:1: style: Lines should not be more than 100 characters.

map <- raster(RandomFields::RFsimulate(model, y = 1:ncSpeedup, x = 1:nrSpeedup, grid = TRUE, ...))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:223:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPoints <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:247:4: style: Commented code should be removed.

#y <- spTransform(x, areaCRS)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:263:3: style: Variable or function name should be lowerCamelCase.

X <- c(jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxX - minX) + minX)),
  ^

R/initialize.R:265:3: style: Variable or function name should be lowerCamelCase.

Y <- c(jitter(sort(rbeta(nPoints / 2, betaPar, betaPar) * (maxY - meanY) + meanY)),
  ^

R/initialize.R:269:3: style: Variable or function name should be lowerCamelCase.

Sr1 <- Polygon(cbind(X + xAdd, Y + yAdd))
  ^~~

R/initialize.R:270:3: style: Variable or function name should be lowerCamelCase.

Srs1 <- Polygons(list(Sr1), "s1")
  ^~~~

R/initialize.R:283:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.matrix <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~

R/initialize.R:300:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPolygons <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

while(need) {
       ^

R/initialize.R:407:3: style: Commented code should be removed.

# ### INCORPORATE RELEVANT PARTS OF THIS OLD INIT FUNCTION INTO INITCOORDS()
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:412:3: style: Commented code should be removed.

# #'                      (currently only \code{RasterLayer} or
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:413:3: style: Commented code should be removed.

# #'                      \code{SpatialPolygonsDataFrame}) accepted.
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:423:7: style: Commented code should be removed.

#     ext <- extent(agentlocation)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:425:9: style: Commented code should be removed.

#       #            nonNAs <- !is.na(getvalue(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:426:9: style: Commented code should be removed.

#       nonNAs <- !is.na(getValues(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:427:9: style: Commented code should be removed.

#       wh.nonNAs <- which(nonNAs)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:428:9: style: Commented code should be removed.

#       #            ProbInit.v <- cumsum(getvalue(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:429:9: style: Commented code should be removed.

#       ProbInit.v <- cumsum(getValues(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:431:11: style: Commented code should be removed.

#         ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:432:11: style: Commented code should be removed.

#         fI <- findInterval(ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:433:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[fI]
          ^~~~~~~~~~~~~~~~~~~~

R/initialize.R:434:11: style: Commented code should be removed.

#         last.ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:435:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:436:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:438:11: style: Commented code should be removed.

#         #                va <- getvalue(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:439:11: style: Commented code should be removed.

#         va <- getValues(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:440:11: style: Commented code should be removed.

#         ran <- runif(length(va), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:441:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:443:11: style: Commented code should be removed.

#         last.ran <- runif(length(fI2), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:444:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v) + 1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:445:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:447:11: style: Commented code should be removed.

#         #                last.ran <- runif(length(fI2),0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:448:11: style: Commented code should be removed.

#         #                last.fI2 <- wh.nonNAs[last.ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:451:11: style: Commented code should be removed.

#         position <- xyFromCell(agentlocation,fI2,spatial = TRUE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:453:11: style: Commented code should be removed.

#         position <- coordinates(agentlocation)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:455:11: style: Commented code should be removed.

#         stop("need raster layer or Spatial Points object")
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:457:9: style: Commented code should be removed.

#       numagents <- length(position)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:465:13: style: Commented code should be removed.

#           colnames(xy) = c("x", "y")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:466:13: style: Commented code should be removed.

#           position <- SpatialPoints(xy)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:467:13: style: Commented code should be removed.

#           position <- SpatialPoints(sampleRandom(agentlocation, numagents, xy = TRUE, sp = TRUE))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:469:13: style: Commented code should be removed.

#           sam <- sample(1:length(agentlocation),numagents)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:470:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation[sam,])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:472:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:479:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:481:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:483:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:491:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:495:7: style: Commented code should be removed.

#     stop("Need to provide agentlocation, which can be a map layer")
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:497:5: style: Commented code should be removed.

#   heading1 <- runif(numagents, 0, 360)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:498:5: style: Commented code should be removed.

#   distance <- runif(numagents, 0.1, 10)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:500:5: style: Commented code should be removed.

#   .Object@ID <- as.character(1:numagents)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:501:5: style: Commented code should be removed.

#   .Object@spatial <- position
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:502:5: style: Commented code should be removed.

#   .Object@heading <- heading1
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:503:5: style: Commented code should be removed.

#   .Object@distance <- distance
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:505:5: style: Commented code should be removed.

#   return(.Object)
    ^~~~~~~~~~~~~~~

R/initialize.R:510:32: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                               ^

R/initialize.R:510:37: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                    ^

R/initialize.R:510:52: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                   ^

R/initialize.R:510:55: style: Put spaces around all infix operators.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                     ~^~

R/initialize.R:510:56: style: Only use double-quotes.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                       ^~

R/initialize.R:514:22: style: Put spaces around all infix operators.

​  (floor((long + 180)/6) %% 60) + 1
                    ~^~

R/mapReduce.R:53:3: style: Variable or function name should be lowerCamelCase.

BsumVec <- reduced[fullRasterVals] # join
  ^~~~~~~

R/neighbourhood.R:114:21: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                    ^~~~~~~~~~~~~~

R/neighbourhood.R:114:45: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                                            ^~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:233:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:238:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:297:1: style: Lines should not be more than 100 characters.

​              ((from %% numCol + to %% numCol) == 1))# | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:806:29: style: Variable or function name should be lowerCamelCase.

setGeneric("wrap", function(X, bounds, withHeading) {
                            ^

R/neighbourhood.R:815:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:832:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:842:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:843:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:852:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:853:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:862:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:865:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
      ^

R/neighbourhood.R:877:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:902:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:903:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:912:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:915:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:1052:40: style: Commas should always have a space after.

cc <- cbind(pureCircle2[, "x"] - xy[,"x"], pureCircle2[, "y"] - xy[, "y"])
                                       ^

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

1 / sqrt(var * 2 * pi) * exp(-((theta - mu + 2 * pi * k) ^ 2) / (2 * var))
                                  ^

R/probability.R:44:3: style: Variable or function name should be lowerCamelCase.

Next <- term(theta, mu, var, k)
  ^~~~

R/probability.R:45:3: style: Variable or function name should be lowerCamelCase.

Last <- Next
  ^~~~

R/RcppExports.R:68:20: style: Variable or function name should be lowerCamelCase.

runifC <- function(N) {
                   ^

R/RcppExports.R:71:1: style: Trailing blank lines are superfluous.

^

R/SELES.R:53:23: style: Variable or function name should be lowerCamelCase.

numAgents <- function(N, probInit) {
                      ^

R/splitRaster.R:116:1: style: Lines should not be more than 100 characters.

​      clusterApplyLB(cl = cl, x = seq_along(extents), fun = croppy, e = extents, r = r, path = path, rType = rType)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:538:8: style: Commented code should be removed.

#isNASpreadProb <- is.na(spreadProb[])
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:540:11: style: Commented code should be removed.

#   isNASpreadProb <- is.na(spreadProb[])
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:541:11: style: Commented code should be removed.

#   spreadProb[isNASpreadProb] <- 0L
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:942:41: style: Place a space before left parenthesis, except in a function call.

notDupsEvents <- notDups[-(1:(nrSpreads - nrPotentials))]
                                        ^

R/spread2.R:5:1: style: Lines should not be more than 100 characters.

"quantityAdj", "quantityAdj2", "state", "size", "tooBigByNCells", "V1", "proportion"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:674:12: style: Commented code should be removed.

#pureCircle <- unique(pureCircle)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:759:13: style: Commented code should be removed.

# colnamesDtPot <- colnames(dtPotential)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:760:13: style: Commented code should be removed.

# ll <-  lapply(colnamesDtPot, function(x) dtPotential[[x]][!spreadProbNA])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:761:13: style: Commented code should be removed.

# names(ll) <- colnamesDtPot
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:762:13: style: Commented code should be removed.

# dtPotential <- as.data.table(ll)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:772:1: style: Lines should not be more than 100 characters.

​                                                                   .I[sample.int(length(numNeighs), size = numNeighs, prob = spreadProbRel)],
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:787:7: style: Variable or function name should be lowerCamelCase.

NAaSP <- !is.na(actualSpreadProb)
      ^~~~~

R/spread2.R:789:42: style: Commas should always have a space after.

dtPotential <- dtPotential[NAaSP,]
                                         ^

R/spread2.R:830:1: style: Lines should not be more than 100 characters.

# this is to prevent overlap within an event... in some cases, overlap within event is desired, so skip this block
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:1: style: Lines should not be more than 100 characters.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:10: style: Commented code should be removed.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:6:11: style: Commented code should be removed.

​    cat("#START##############\n", file = tmpExFile, append = FALSE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:17:5: style: Commas should never have a space before.

​  } , add = TRUE)
   ~^

tests/testthat/test-mapReduce.R:23:4: style: Commented code should be removed.

#expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:27:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:28:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:31:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:35:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:36:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:37:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:38:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:42:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:44:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:46:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:47:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(biomass))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:49:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:50:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:51:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:52:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:56:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:57:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:60:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:64:5: style: Commented code should be removed.

#   ras <- raster(extent(0, 15, 0, 15), res = 1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:65:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes = 5, speedup = 1, p = 0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:67:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:71:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu = 4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:73:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:75:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:76:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:77:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:81:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:82:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:85:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:89:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:90:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:91:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:92:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:96:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:98:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R💯5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:101:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:102:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:4:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:5:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:10:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:13:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:33:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:34:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:39:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:42:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:52:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:55:1: style: Lines should not be more than 100 characters.

​test_that("mergeRaster will use mosaic with default mean if rasters are resampled and fun if passed", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:58:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:59:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:64:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:67:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-randomPolygon.R:24:60: style: Put spaces around all infix operators.

​  expect_true(base::abs(base::abs(polyArea - area)) <  area/4) ## TODO: why is this area/4?
                                                          ~^~

tests/testthat/test-randomPolygon.R:28:3: style: Variable or function name should be lowerCamelCase.

centerSP_UTM <- sp::spTransform(centerSP, CRSobj = raster::crs(poly1InUTM))
  ^~~~~~~~~~~~

tests/testthat/test-randomPolygon.R:30:1: style: Lines should not be more than 100 characters.

​  expect_true(raster::pointDistance(centerSP_UTM, polyCenter, lonlat = FALSE) < 100) ## TODO: appropriate test?
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:148:38: style: Commas should always have a space after.

​  expect_identical(dataType(y4[[1]]),"INT1U")
                                     ^

tests/testthat/test-splitRaster.R:165:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-parallel") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:168:8: style: Commented code should be removed.

#detach("package:raster")
       ^~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:226:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-large") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:264:4: style: Commented code should be removed.

#expect_equal(min(values(m)), min(values(r))) ## Error: cannot allocate vector of size 4.8 Gb
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:283:4: style: Commented code should be removed.

#expect_equal(max(values(m1)), max(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:284:4: style: Commented code should be removed.

#expect_equal(min(values(m1)), min(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread.R:209:1: style: Lines should not be more than 100 characters.

if (interactive()) Plot(circEdge, addTo = "circs", cols = c("transparent", rainbow(numCircs)[whCirc]))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:148:4: style: Commented code should be removed.

#quickDT <- data.table(id = seq_along(sams), initialPixels = sams, key = "id")
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:150:4: style: Commented code should be removed.

#cirOut <- quickDT[cirOut, on = ]
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:473:1: style: Lines should not be more than 100 characters.

##                                    expr       min        lq      mean   median        uq       max neval
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:474:1: style: Lines should not be more than 100 characters.

##         iterativeFun(ras, FALSE, n, sp)  3.096979 12.642477  73.02248 35.17520  91.10528  764.4073   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:475:1: style: Lines should not be more than 100 characters.

##      nonIterativeFun(ras, FALSE, n, sp)  1.509484  6.555565  31.18444 14.91066  42.78317  158.5237   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:476:1: style: Lines should not be more than 100 characters.

##           origSpread(ras, FALSE, n, sp)  5.154006  7.555631  14.87158 11.49005  17.50599  231.5487   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:477:1: style: Lines should not be more than 100 characters.

## origSpreadIterations(ras, FALSE, n, sp) 10.754669 51.524368 141.48620 93.61996 169.10808 2110.2683   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:688:38: style: Place a space before left parenthesis, except in a function call.

ciCentre[seq_len(ncell(ciCentre))[-(ncell(ciCentre) / 2 - ncol(ciCentre) / 2)]] <- NA_integer_
                                     ^

tests/testthat/test-spread2.R:884:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:886:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0.8, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:891:3: style: Variable or function name should be lowerCamelCase.

M <- matrix(0.8, nrow = 50, ncol = 50)
  ^

tests/testthat/test-spread2.R:898:35: style: Put spaces around all infix operators.

start <- c(50, length(landscape)-49)
                                 ~^~

tests/testthat/test-spread2.R:902:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = persistRas, iterations = 10, directions = 8L,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:916:14: style: Use <-, not =, for assignment.

spreadProb = landscape
             ^

tests/testthat/test-spread2.R:918:72: style: Commas should always have a space after.

​  expect_silent(spread2(landscape = landscape, spreadProb = spreadProb,start = start,
                                                                       ^

This comment has been minimized.

Copy link

lintr-bot replied Jan 28, 2019

inst/examples/example_distanceFromEachPoint.R:37:2: style: Commented code should be removed.

#beginCluster(3) # can do parallel
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/examples/example_distanceFromEachPoint.R:40:2: style: Commented code should be removed.

#endCluster() # if beginCluster was run
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:83:11: style: Do not place spaces around code in parentheses or square brackets.

if ( method != "RMexp") {
          ^

R/initialize.R:88:1: style: Lines should not be more than 100 characters.

map <- raster(RandomFields::RFsimulate(model, y = 1:ncSpeedup, x = 1:nrSpeedup, grid = TRUE, ...))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:223:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPoints <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:247:4: style: Commented code should be removed.

#y <- spTransform(x, areaCRS)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:263:3: style: Variable or function name should be lowerCamelCase.

X <- c(jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxX - minX) + minX)),
  ^

R/initialize.R:265:3: style: Variable or function name should be lowerCamelCase.

Y <- c(jitter(sort(rbeta(nPoints / 2, betaPar, betaPar) * (maxY - meanY) + meanY)),
  ^

R/initialize.R:269:3: style: Variable or function name should be lowerCamelCase.

Sr1 <- Polygon(cbind(X + xAdd, Y + yAdd))
  ^~~

R/initialize.R:270:3: style: Variable or function name should be lowerCamelCase.

Srs1 <- Polygons(list(Sr1), "s1")
  ^~~~

R/initialize.R:283:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.matrix <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~

R/initialize.R:300:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPolygons <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

while(need) {
       ^

R/initialize.R:407:3: style: Commented code should be removed.

# ### INCORPORATE RELEVANT PARTS OF THIS OLD INIT FUNCTION INTO INITCOORDS()
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:412:3: style: Commented code should be removed.

# #'                      (currently only \code{RasterLayer} or
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:413:3: style: Commented code should be removed.

# #'                      \code{SpatialPolygonsDataFrame}) accepted.
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:423:7: style: Commented code should be removed.

#     ext <- extent(agentlocation)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:425:9: style: Commented code should be removed.

#       #            nonNAs <- !is.na(getvalue(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:426:9: style: Commented code should be removed.

#       nonNAs <- !is.na(getValues(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:427:9: style: Commented code should be removed.

#       wh.nonNAs <- which(nonNAs)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:428:9: style: Commented code should be removed.

#       #            ProbInit.v <- cumsum(getvalue(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:429:9: style: Commented code should be removed.

#       ProbInit.v <- cumsum(getValues(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:431:11: style: Commented code should be removed.

#         ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:432:11: style: Commented code should be removed.

#         fI <- findInterval(ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:433:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[fI]
          ^~~~~~~~~~~~~~~~~~~~

R/initialize.R:434:11: style: Commented code should be removed.

#         last.ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:435:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:436:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:438:11: style: Commented code should be removed.

#         #                va <- getvalue(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:439:11: style: Commented code should be removed.

#         va <- getValues(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:440:11: style: Commented code should be removed.

#         ran <- runif(length(va), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:441:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:443:11: style: Commented code should be removed.

#         last.ran <- runif(length(fI2), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:444:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v) + 1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:445:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:447:11: style: Commented code should be removed.

#         #                last.ran <- runif(length(fI2),0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:448:11: style: Commented code should be removed.

#         #                last.fI2 <- wh.nonNAs[last.ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:451:11: style: Commented code should be removed.

#         position <- xyFromCell(agentlocation,fI2,spatial = TRUE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:453:11: style: Commented code should be removed.

#         position <- coordinates(agentlocation)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:455:11: style: Commented code should be removed.

#         stop("need raster layer or Spatial Points object")
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:457:9: style: Commented code should be removed.

#       numagents <- length(position)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:465:13: style: Commented code should be removed.

#           colnames(xy) = c("x", "y")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:466:13: style: Commented code should be removed.

#           position <- SpatialPoints(xy)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:467:13: style: Commented code should be removed.

#           position <- SpatialPoints(sampleRandom(agentlocation, numagents, xy = TRUE, sp = TRUE))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:469:13: style: Commented code should be removed.

#           sam <- sample(1:length(agentlocation),numagents)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:470:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation[sam,])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:472:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:479:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:481:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:483:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:491:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:495:7: style: Commented code should be removed.

#     stop("Need to provide agentlocation, which can be a map layer")
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:497:5: style: Commented code should be removed.

#   heading1 <- runif(numagents, 0, 360)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:498:5: style: Commented code should be removed.

#   distance <- runif(numagents, 0.1, 10)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:500:5: style: Commented code should be removed.

#   .Object@ID <- as.character(1:numagents)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:501:5: style: Commented code should be removed.

#   .Object@spatial <- position
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:502:5: style: Commented code should be removed.

#   .Object@heading <- heading1
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:503:5: style: Commented code should be removed.

#   .Object@distance <- distance
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:505:5: style: Commented code should be removed.

#   return(.Object)
    ^~~~~~~~~~~~~~~

R/initialize.R:510:32: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                               ^

R/initialize.R:510:37: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                    ^

R/initialize.R:510:52: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                   ^

R/initialize.R:510:55: style: Put spaces around all infix operators.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                     ~^~

R/initialize.R:510:56: style: Only use double-quotes.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                       ^~

R/initialize.R:514:22: style: Put spaces around all infix operators.

​  (floor((long + 180)/6) %% 60) + 1
                    ~^~

R/mapReduce.R:53:3: style: Variable or function name should be lowerCamelCase.

BsumVec <- reduced[fullRasterVals] # join
  ^~~~~~~

R/neighbourhood.R:114:21: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                    ^~~~~~~~~~~~~~

R/neighbourhood.R:114:45: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                                            ^~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:233:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:238:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:297:1: style: Lines should not be more than 100 characters.

​              ((from %% numCol + to %% numCol) == 1))# | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:806:29: style: Variable or function name should be lowerCamelCase.

setGeneric("wrap", function(X, bounds, withHeading) {
                            ^

R/neighbourhood.R:815:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:832:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:842:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:843:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:852:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:853:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:862:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:865:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
      ^

R/neighbourhood.R:877:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:902:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:903:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:912:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds, withHeading) {
                        ^

R/neighbourhood.R:915:7: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds), withHeading = withHeading)
      ^

R/neighbourhood.R:1052:40: style: Commas should always have a space after.

cc <- cbind(pureCircle2[, "x"] - xy[,"x"], pureCircle2[, "y"] - xy[, "y"])
                                       ^

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

1 / sqrt(var * 2 * pi) * exp(-((theta - mu + 2 * pi * k) ^ 2) / (2 * var))
                                  ^

R/probability.R:44:3: style: Variable or function name should be lowerCamelCase.

Next <- term(theta, mu, var, k)
  ^~~~

R/probability.R:45:3: style: Variable or function name should be lowerCamelCase.

Last <- Next
  ^~~~

R/RcppExports.R:68:20: style: Variable or function name should be lowerCamelCase.

runifC <- function(N) {
                   ^

R/RcppExports.R:71:1: style: Trailing blank lines are superfluous.

^

R/SELES.R:53:23: style: Variable or function name should be lowerCamelCase.

numAgents <- function(N, probInit) {
                      ^

R/splitRaster.R:116:1: style: Lines should not be more than 100 characters.

​      clusterApplyLB(cl = cl, x = seq_along(extents), fun = croppy, e = extents, r = r, path = path, rType = rType)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:538:8: style: Commented code should be removed.

#isNASpreadProb <- is.na(spreadProb[])
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:540:11: style: Commented code should be removed.

#   isNASpreadProb <- is.na(spreadProb[])
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:541:11: style: Commented code should be removed.

#   spreadProb[isNASpreadProb] <- 0L
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread.R:942:41: style: Place a space before left parenthesis, except in a function call.

notDupsEvents <- notDups[-(1:(nrSpreads - nrPotentials))]
                                        ^

R/spread2.R:5:1: style: Lines should not be more than 100 characters.

"quantityAdj", "quantityAdj2", "state", "size", "tooBigByNCells", "V1", "proportion"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:674:12: style: Commented code should be removed.

#pureCircle <- unique(pureCircle)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:759:13: style: Commented code should be removed.

# colnamesDtPot <- colnames(dtPotential)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:760:13: style: Commented code should be removed.

# ll <-  lapply(colnamesDtPot, function(x) dtPotential[[x]][!spreadProbNA])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:761:13: style: Commented code should be removed.

# names(ll) <- colnamesDtPot
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:762:13: style: Commented code should be removed.

# dtPotential <- as.data.table(ll)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:772:1: style: Lines should not be more than 100 characters.

​                                                                   .I[sample.int(length(numNeighs), size = numNeighs, prob = spreadProbRel)],
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:787:7: style: Variable or function name should be lowerCamelCase.

NAaSP <- !is.na(actualSpreadProb)
      ^~~~~

R/spread2.R:789:42: style: Commas should always have a space after.

dtPotential <- dtPotential[NAaSP,]
                                         ^

R/spread2.R:830:1: style: Lines should not be more than 100 characters.

# this is to prevent overlap within an event... in some cases, overlap within event is desired, so skip this block
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:1: style: Lines should not be more than 100 characters.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/spread2.R:848:10: style: Commented code should be removed.

#successCells <- na.omit(successCells[!dupsWithinDtPotential]) # remove the dupsWithinDtPotential
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:6:11: style: Commented code should be removed.

​    cat("#START##############\n", file = tmpExFile, append = FALSE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:17:5: style: Commas should never have a space before.

​  } , add = TRUE)
   ~^

tests/testthat/test-mapReduce.R:23:4: style: Commented code should be removed.

#expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:27:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:28:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:31:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:35:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:36:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:37:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:38:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:42:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:44:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:46:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(biomass))), sort(reducedDT$biomass))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:47:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(biomass))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:49:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:50:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:51:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:52:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:56:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:57:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:60:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:64:5: style: Commented code should be removed.

#   ras <- raster(extent(0, 15, 0, 15), res = 1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:65:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes = 5, speedup = 1, p = 0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:67:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:71:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu = 4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:73:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:75:5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:76:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:77:5: style: Commented code should be removed.

#   expect_equal(sort(unique(getValues(communities))), sort(reducedDT$communities))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:81:5: style: Commented code should be removed.

#   library(data.table)
    ^~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:82:5: style: Commented code should be removed.

#   library(raster)
    ^~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:85:6: style: Commented code should be removed.

#    detach("package:data.table")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:89:5: style: Commented code should be removed.

#   ras <- raster(extent(0,15,0,15), res=1)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:90:5: style: Commented code should be removed.

#   fullRas <- randomPolygons(ras, numTypes=5, speedup=1, p=0.3)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:91:5: style: Commented code should be removed.

#   names(fullRas) <- "mapcodeAll"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:92:5: style: Commented code should be removed.

#   uniqueComms <- raster::unique(fullRas)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:96:7: style: Commented code should be removed.

#     biomass=rnbinom(length(uniqueComms), mu=4000, 0.4)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:98:5: style: Commented code should be removed.

#   biomass <- rasterizeReduced(reducedDT, fullRas, "biomass")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R💯5: style: Commented code should be removed.

#   setkey(reducedDT, biomass)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:101:5: style: Commented code should be removed.

#   communities <- rasterizeReduced(reducedDT, fullRas, "communities")
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mapReduce.R:102:5: style: Commented code should be removed.

#   expect_equal(length(unique(getValues(communities))), length(unique(getValues(fullRas))))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:4:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:5:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:10:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:13:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:33:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:34:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:39:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:42:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-mergeRaster.R:52:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:55:1: style: Lines should not be more than 100 characters.

​test_that("mergeRaster will use mosaic with default mean if rasters are resampled and fun if passed", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mergeRaster.R:58:6: style: Use <-, not =, for assignment.

nx = 3
     ^

tests/testthat/test-mergeRaster.R:59:6: style: Use <-, not =, for assignment.

ny = 3
     ^

tests/testthat/test-mergeRaster.R:64:54: style: Commas should never have a space before.

vals = round(runif(n = 14400 , min = 1, max = 10)))
                                                    ~^

tests/testthat/test-mergeRaster.R:67:29: style: Put spaces around all infix operators.

​  expect_length(splitted, nx*ny)
                           ~^~

tests/testthat/test-randomPolygon.R:24:60: style: Put spaces around all infix operators.

​  expect_true(base::abs(base::abs(polyArea - area)) <  area/4) ## TODO: why is this area/4?
                                                          ~^~

tests/testthat/test-randomPolygon.R:28:3: style: Variable or function name should be lowerCamelCase.

centerSP_UTM <- sp::spTransform(centerSP, CRSobj = raster::crs(poly1InUTM))
  ^~~~~~~~~~~~

tests/testthat/test-randomPolygon.R:30:1: style: Lines should not be more than 100 characters.

​  expect_true(raster::pointDistance(centerSP_UTM, polyCenter, lonlat = FALSE) < 100) ## TODO: appropriate test?
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:148:38: style: Commas should always have a space after.

​  expect_identical(dataType(y4[[1]]),"INT1U")
                                     ^

tests/testthat/test-splitRaster.R:165:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-parallel") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:168:8: style: Commented code should be removed.

#detach("package:raster")
       ^~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:226:1: style: Lines should not be more than 100 characters.

tmpdir <- file.path(tempdir(), "splitRaster-test-large") %>% reproducible::checkPath(create = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:264:4: style: Commented code should be removed.

#expect_equal(min(values(m)), min(values(r))) ## Error: cannot allocate vector of size 4.8 Gb
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:283:4: style: Commented code should be removed.

#expect_equal(max(values(m1)), max(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-splitRaster.R:284:4: style: Commented code should be removed.

#expect_equal(min(values(m1)), min(values(r)))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread.R:209:1: style: Lines should not be more than 100 characters.

if (interactive()) Plot(circEdge, addTo = "circs", cols = c("transparent", rainbow(numCircs)[whCirc]))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:148:4: style: Commented code should be removed.

#quickDT <- data.table(id = seq_along(sams), initialPixels = sams, key = "id")
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:150:4: style: Commented code should be removed.

#cirOut <- quickDT[cirOut, on = ]
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:473:1: style: Lines should not be more than 100 characters.

##                                    expr       min        lq      mean   median        uq       max neval
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:474:1: style: Lines should not be more than 100 characters.

##         iterativeFun(ras, FALSE, n, sp)  3.096979 12.642477  73.02248 35.17520  91.10528  764.4073   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:475:1: style: Lines should not be more than 100 characters.

##      nonIterativeFun(ras, FALSE, n, sp)  1.509484  6.555565  31.18444 14.91066  42.78317  158.5237   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:476:1: style: Lines should not be more than 100 characters.

##           origSpread(ras, FALSE, n, sp)  5.154006  7.555631  14.87158 11.49005  17.50599  231.5487   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:477:1: style: Lines should not be more than 100 characters.

## origSpreadIterations(ras, FALSE, n, sp) 10.754669 51.524368 141.48620 93.61996 169.10808 2110.2683   300
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:688:38: style: Place a space before left parenthesis, except in a function call.

ciCentre[seq_len(ncell(ciCentre))[-(ncell(ciCentre) / 2 - ncol(ciCentre) / 2)]] <- NA_integer_
                                     ^

tests/testthat/test-spread2.R:884:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:886:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = 0.8, iterations = 10, directions = 8L, plot.it = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:891:3: style: Variable or function name should be lowerCamelCase.

M <- matrix(0.8, nrow = 50, ncol = 50)
  ^

tests/testthat/test-spread2.R:898:35: style: Put spaces around all infix operators.

start <- c(50, length(landscape)-49)
                                 ~^~

tests/testthat/test-spread2.R:902:1: style: Lines should not be more than 100 characters.

spreadProb = 0.23, persistProb = persistRas, iterations = 10, directions = 8L,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-spread2.R:916:14: style: Use <-, not =, for assignment.

spreadProb = landscape
             ^

tests/testthat/test-spread2.R:918:72: style: Commas should always have a space after.

​  expect_silent(spread2(landscape = landscape, spreadProb = spreadProb,start = start,
                                                                       ^

This comment has been minimized.

Copy link

lintr-bot replied Jan 28, 2019

inst/examples/example_distanceFromEachPoint.R:37:2: style: Commented code should be removed.

#beginCluster(3) # can do parallel
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/examples/example_distanceFromEachPoint.R:40:2: style: Commented code should be removed.

#endCluster() # if beginCluster was run
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:83:11: style: Do not place spaces around code in parentheses or square brackets.

if ( method != "RMexp") {
          ^

R/initialize.R:88:1: style: Lines should not be more than 100 characters.

map <- raster(RandomFields::RFsimulate(model, y = 1:ncSpeedup, x = 1:nrSpeedup, grid = TRUE, ...))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:223:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPoints <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:247:4: style: Commented code should be removed.

#y <- spTransform(x, areaCRS)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:263:3: style: Variable or function name should be lowerCamelCase.

X <- c(jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxX - minX) + minX)),
  ^

R/initialize.R:265:3: style: Variable or function name should be lowerCamelCase.

Y <- c(jitter(sort(rbeta(nPoints / 2, betaPar, betaPar) * (maxY - meanY) + meanY)),
  ^

R/initialize.R:269:3: style: Variable or function name should be lowerCamelCase.

Sr1 <- Polygon(cbind(X + xAdd, Y + yAdd))
  ^~~

R/initialize.R:270:3: style: Variable or function name should be lowerCamelCase.

Srs1 <- Polygons(list(Sr1), "s1")
  ^~~~

R/initialize.R:283:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.matrix <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~

R/initialize.R:300:1: style: Variable or function name should be lowerCamelCase.

randomPolygon.SpatialPolygons <- function(x, hectares, area) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

while(need) {
       ^

R/initialize.R:407:3: style: Commented code should be removed.

# ### INCORPORATE RELEVANT PARTS OF THIS OLD INIT FUNCTION INTO INITCOORDS()
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:412:3: style: Commented code should be removed.

# #'                      (currently only \code{RasterLayer} or
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:413:3: style: Commented code should be removed.

# #'                      \code{SpatialPolygonsDataFrame}) accepted.
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:423:7: style: Commented code should be removed.

#     ext <- extent(agentlocation)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:425:9: style: Commented code should be removed.

#       #            nonNAs <- !is.na(getvalue(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:426:9: style: Commented code should be removed.

#       nonNAs <- !is.na(getValues(probinit))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:427:9: style: Commented code should be removed.

#       wh.nonNAs <- which(nonNAs)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:428:9: style: Commented code should be removed.

#       #            ProbInit.v <- cumsum(getvalue(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:429:9: style: Commented code should be removed.

#       ProbInit.v <- cumsum(getValues(probinit)[nonNAs])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:431:11: style: Commented code should be removed.

#         ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:432:11: style: Commented code should be removed.

#         fI <- findInterval(ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:433:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[fI]
          ^~~~~~~~~~~~~~~~~~~~

R/initialize.R:434:11: style: Commented code should be removed.

#         last.ran <- runif(numagents,0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:435:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v)+1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:436:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:438:11: style: Commented code should be removed.

#         #                va <- getvalue(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:439:11: style: Commented code should be removed.

#         va <- getValues(probinit)[nonNAs]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:440:11: style: Commented code should be removed.

#         ran <- runif(length(va), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:441:11: style: Commented code should be removed.

#         fI2 <- wh.nonNAs[ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:443:11: style: Commented code should be removed.

#         last.ran <- runif(length(fI2), 0, 1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:444:11: style: Commented code should be removed.

#         last.fI <- findInterval(last.ran, ProbInit.v) + 1
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:445:11: style: Commented code should be removed.

#         last.fI2 <- wh.nonNAs[last.fI]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:447:11: style: Commented code should be removed.

#         #                last.ran <- runif(length(fI2),0,1)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:448:11: style: Commented code should be removed.

#         #                last.fI2 <- wh.nonNAs[last.ran<va]
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:451:11: style: Commented code should be removed.

#         position <- xyFromCell(agentlocation,fI2,spatial = TRUE)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:453:11: style: Commented code should be removed.

#         position <- coordinates(agentlocation)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:455:11: style: Commented code should be removed.

#         stop("need raster layer or Spatial Points object")
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:457:9: style: Commented code should be removed.

#       numagents <- length(position)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:465:13: style: Commented code should be removed.

#           colnames(xy) = c("x", "y")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:466:13: style: Commented code should be removed.

#           position <- SpatialPoints(xy)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:467:13: style: Commented code should be removed.

#           position <- SpatialPoints(sampleRandom(agentlocation, numagents, xy = TRUE, sp = TRUE))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:469:13: style: Commented code should be removed.

#           sam <- sample(1:length(agentlocation),numagents)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:470:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation[sam,])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:472:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:479:13: style: Commented code should be removed.

#           position <- SpatialPoints(agentlocation)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:481:13: style: Commented code should be removed.

#           stop("need raster layer or Spatial Points object")
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:483:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:491:11: style: Commented code should be removed.

#         numagents <- length(position)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:495:7: style: Commented code should be removed.

#     stop("Need to provide agentlocation, which can be a map layer")
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:497:5: style: Commented code should be removed.

#   heading1 <- runif(numagents, 0, 360)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:498:5: style: Commented code should be removed.

#   distance <- runif(numagents, 0.1, 10)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:500:5: style: Commented code should be removed.

#   .Object@ID <- as.character(1:numagents)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:501:5: style: Commented code should be removed.

#   .Object@spatial <- position
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:502:5: style: Commented code should be removed.

#   .Object@heading <- heading1
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:503:5: style: Commented code should be removed.

#   .Object@distance <- distance
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/initialize.R:505:5: style: Commented code should be removed.

#   return(.Object)
    ^~~~~~~~~~~~~~~

R/initialize.R:510:32: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                               ^

R/initialize.R:510:37: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                    ^

R/initialize.R:510:52: style: Commas should always have a space after.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                   ^

R/initialize.R:510:55: style: Put spaces around all infix operators.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                     ~^~

R/initialize.R:510:56: style: Only use double-quotes.

​  CRS(paste("+proj=utm +zone=",zone," ellps=WGS84",sep=''))
                                                       ^~

R/initialize.R:514:22: style: Put spaces around all infix operators.

​  (floor((long + 180)/6) %% 60) + 1
                    ~^~

R/mapReduce.R:53:3: style: Variable or function name should be lowerCamelCase.

BsumVec <- reduced[fullRasterVals] # join
  ^~~~~~~

R/neighbourhood.R:114:21: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                    ^~~~~~~~~~~~~~

R/neighbourhood.R:114:45: style: Variable or function name should be lowerCamelCase.

match.adjacent = FALSE, cutoff.for.data.table = 2e3,
                                            ^~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:233:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:238:1: style: Lines should not be more than 100 characters.

​              ((adj[, "from"] %% numCol + adj[, "to"] %% numCol) == 1)) # | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:297:1: style: Lines should not be more than 100 characters.

​              ((from %% numCol + to %% numCol) == 1))# | #right & left edge cells, with neighbours wrapped
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/neighbourhood.R:806:29: style: Variable or function name should be lowerCamelCase.

setGeneric("wrap", function(X, bounds, withHeading) {
                            ^

R/neighbourhood.R:815:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:832:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:842:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:843:5: style: Variable or function name should be lowerCamelCase.

X <- wrap(X, bounds = extent(bounds))
    ^

R/neighbourhood.R:852:25: style: Variable or function name should be lowerCamelCase.

definition = function(X, bounds) {
                        ^

R/neighbourhood.R:853:5: style: Variable or function name should be lowerCamelCase.

X <-