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

Fixed issue with NA values in raster #14

Merged
merged 24 commits into from Apr 25, 2018

Conversation

Projects
None yet
4 participants
@CeresBarros
Contributor

CeresBarros commented Apr 25, 2018

This was producing an error:

library(raster)
levs <- c(0:5, 7:23)
ras <- raster(extent(0, 3, 0, 2), vals = c(NA, 1, 3, 5, 8, 9), res = 1)
levels(ras) <- data.frame(ID = levs, Name = LETTERS[1:23])
Plot(ras, new = TRUE)

> Error in if (isFac) { : missing value where TRUE/FALSE needed 

It is now solved, at least in this particular case.

@lintr-bot

This comment has been minimized.

lintr-bot commented on bac0c12 Feb 9, 2018

R/plotting-colours.R:89:23: style: Put spaces around all infix operators.

if (all(object[]%%1==0)) { # some factor rasters are actually real number -- makes no sense
                     ~^~~

R/plotting-colours.R:89:26: style: Put spaces around all infix operators.

if (all(object[]%%1==0)) { # some factor rasters are actually real number -- makes no sense
                        ~^~~

R/plotting-colours.R:89:32: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(object[]%%1==0)) { # some factor rasters are actually real number -- makes no sense
                               ^

R/plotting-colours.R:106:23: style: Put spaces around all infix operators.

if (all(object[]%%1==0)) { # some factor rasters are actually real number -- makes no sense
                     ~^~~

R/plotting-colours.R:106:26: style: Put spaces around all infix operators.

if (all(object[]%%1==0)) { # some factor rasters are actually real number -- makes no sense
                        ~^~~

R/plotting-colours.R:106:32: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(object[]%%1==0)) { # some factor rasters are actually real number -- makes no sense
                               ^

R/plotting-colours.R:131:23: style: Put spaces around all infix operators.

if (all(object[]%%1==0)) { # some factor rasters are actually real number -- makes no sense
                     ~^~~

R/plotting-colours.R:131:26: style: Put spaces around all infix operators.

if (all(object[]%%1==0)) { # some factor rasters are actually real number -- makes no sense
                        ~^~~

R/plotting-colours.R:131:32: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(object[]%%1==0)) { # some factor rasters are actually real number -- makes no sense
                               ^

R/plotting-colours.R:283:67: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                 ~^~~

R/plotting-colours.R:283:70: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                    ~^~~

R/plotting-helpers.R:1269:33: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                               ~^~~

R/plotting-helpers.R:1269:36: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                                  ~^~~

R/plotting-helpers.R:1358:1: style: Lines should not be more than 100 characters.

​    grid.rect(x = 0, height = unit(1 + needsNewTitle * inherits(grobToPlot, "Raster") * 0.20 / (nRows / 2), "npc"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-other.R:199:48: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                              ~^~~

R/plotting-other.R:199:51: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                                 ~^~~

eliotmcintire added some commits Feb 13, 2018

@lintr-bot

This comment has been minimized.

lintr-bot commented on 5b18099 Feb 15, 2018

R/plotting-colours.R:89:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:89:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:89:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:89:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:106:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:106:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:106:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:106:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:131:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:131:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:131:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:131:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:283:67: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                 ~^~~

R/plotting-colours.R:283:70: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                    ~^~~

R/plotting-helpers.R:1269:33: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                               ~^~~

R/plotting-helpers.R:1269:36: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                                  ~^~~

R/plotting-helpers.R:1358:1: style: Lines should not be more than 100 characters.

​    grid.rect(x = 0, height = unit(1 + needsNewTitle * inherits(grobToPlot, "Raster") * 0.20 / (nRows / 2), "npc"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-other.R:199:48: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                              ~^~~

R/plotting-other.R:199:51: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                                 ~^~~

tests/testthat/test-Plot-nonVisual.R:65:21: style: Commented code should be removed.

​  library(raster); #on.exit(detach("package:raster"), add = TRUE)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-Plot-nonVisual.R:70:3: style: Variable or function name should be lowerCamelCase.

N <- ncol * nrow
  ^
@lintr-bot

This comment has been minimized.

lintr-bot commented on d37f950 Mar 6, 2018

R/plotting-colours.R:89:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:89:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:89:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:89:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:106:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:106:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:106:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:106:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:131:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:131:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:131:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:131:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:283:67: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                 ~^~~

R/plotting-colours.R:283:70: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                    ~^~~

R/plotting-helpers.R:1269:33: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                               ~^~~

R/plotting-helpers.R:1269:36: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                                  ~^~~

R/plotting-helpers.R:1358:1: style: Lines should not be more than 100 characters.

​    grid.rect(x = 0, height = unit(1 + needsNewTitle * inherits(grobToPlot, "Raster") * 0.20 / (nRows / 2), "npc"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-other.R:199:48: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                              ~^~~

R/plotting-other.R:199:51: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                                 ~^~~

tests/testthat/test-Plot-nonVisual.R:65:21: style: Commented code should be removed.

​  library(raster); #on.exit(detach("package:raster"), add = TRUE)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-Plot-nonVisual.R:70:3: style: Variable or function name should be lowerCamelCase.

N <- ncol * nrow
  ^

eliotmcintire added some commits Mar 22, 2018

thin
Merge remote-tracking branch 'origin/development' into development


thin


Merge branch 'development' into thin


Merge branch 'development' into thin
@lintr-bot

This comment has been minimized.

lintr-bot commented on 26e7f0e Mar 22, 2018

R/plotting-colours.R:89:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:89:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:89:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:89:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:106:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:106:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:106:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:106:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:131:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:131:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:131:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:131:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:283:67: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                 ~^~~

R/plotting-colours.R:283:70: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                    ~^~~

R/plotting-helpers.R:1269:33: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                               ~^~~

R/plotting-helpers.R:1269:36: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                                  ~^~~

R/plotting-helpers.R:1358:1: style: Lines should not be more than 100 characters.

​    grid.rect(x = 0, height = unit(1 + needsNewTitle * inherits(grobToPlot, "Raster") * 0.20 / (nRows / 2), "npc"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2503:1: style: Lines should not be more than 100 characters.

#'          jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxY - minY) + minY, decreasing = TRUE)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2578:1: style: Variable or function name should be lowerCamelCase.

thin.SpatialPolygons <- function(x, tolerance = NULL, returnMatrix = FALSE, minCoordsToThin = 0) {
^~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2596:41: style: Commas should always have a space after.

xyOrd[["idLength"]] <- xyOrdDT[,list(V1=.N),by=groups]
                                        ^

R/plotting-helpers.R:2596:48: style: Put spaces around all infix operators.

xyOrd[["idLength"]] <- xyOrdDT[,list(V1=.N),by=groups]
                                              ~^~

R/plotting-helpers.R:2596:53: style: Commas should always have a space after.

xyOrd[["idLength"]] <- xyOrdDT[,list(V1=.N),by=groups]
                                                    ^

R/plotting-helpers.R:2596:55: style: Put spaces around all infix operators.

xyOrd[["idLength"]] <- xyOrdDT[,list(V1=.N),by=groups]
                                                     ~^~

R/plotting-helpers.R:2642:1: style: Variable or function name should be lowerCamelCase.

thin.default <- function(x, tolerance, returnMatrix, minCoordsToThin) {
^~~~~~~~~~~~

R/plotting-helpers.R:2689:5: style: Variable or function name should be lowerCamelCase.

Polygons <- rep(rep(seq(numPolygons), numPolygon), idLength$V1)
    ^~~~~~~~

R/plotting-helpers.R:2690:5: style: Variable or function name should be lowerCamelCase.

Polygon <- rep(unlist(lapply(numPolygon, seq)), idLength$V1)
    ^~~~~~~

R/plotting-helpers.R:2697:36: style: Commas should always have a space after.

return(data.frame(lat = xyOrd[,1], long = xyOrd[,2], order = orders,
                                   ^

R/plotting-helpers.R:2697:54: style: Commas should always have a space after.

return(data.frame(lat = xyOrd[,1], long = xyOrd[,2], order = orders,
                                                     ^

R/plotting-helpers.R:2699:1: style: Lines should not be more than 100 characters.

#group = paste0(as.character(Polygons), ".", as.character(Polygon)))) # the actual fortify
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2702:29: style: Commas should always have a space after.

out <- cbind(x = xyOrd[,1], y = xyOrd[,2], groups = groups)
                            ^

R/plotting-helpers.R:2702:44: style: Commas should always have a space after.

out <- cbind(x = xyOrd[,1], y = xyOrd[,2], groups = groups)
                                           ^

R/plotting-other.R:199:48: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                              ~^~~

R/plotting-other.R:199:51: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                                 ~^~~

tests/testthat/test-Plot-nonVisual.R:65:21: style: Commented code should be removed.

​  library(raster); #on.exit(detach("package:raster"), add = TRUE)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-Plot-nonVisual.R:70:3: style: Variable or function name should be lowerCamelCase.

N <- ncol * nrow
  ^
@lintr-bot

This comment has been minimized.

lintr-bot commented on a480a12 Mar 22, 2018

R/plotting-colours.R:89:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:89:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:89:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:89:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:106:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:106:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:106:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:106:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:131:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:131:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:131:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:131:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:283:67: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                 ~^~~

R/plotting-colours.R:283:70: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                    ~^~~

R/plotting-helpers.R:1269:33: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                               ~^~~

R/plotting-helpers.R:1269:36: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                                  ~^~~

R/plotting-helpers.R:1358:1: style: Lines should not be more than 100 characters.

​    grid.rect(x = 0, height = unit(1 + needsNewTitle * inherits(grobToPlot, "Raster") * 0.20 / (nRows / 2), "npc"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2503:1: style: Lines should not be more than 100 characters.

#'          jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxY - minY) + minY, decreasing = TRUE)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2578:1: style: Variable or function name should be lowerCamelCase.

thin.SpatialPolygons <- function(x, tolerance = NULL, returnMatrix = FALSE, minCoordsToThin = 0) {
^~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2596:41: style: Commas should always have a space after.

xyOrd[["idLength"]] <- xyOrdDT[,list(V1=.N),by=groups]
                                        ^

R/plotting-helpers.R:2596:48: style: Put spaces around all infix operators.

xyOrd[["idLength"]] <- xyOrdDT[,list(V1=.N),by=groups]
                                              ~^~

R/plotting-helpers.R:2596:53: style: Commas should always have a space after.

xyOrd[["idLength"]] <- xyOrdDT[,list(V1=.N),by=groups]
                                                    ^

R/plotting-helpers.R:2596:55: style: Put spaces around all infix operators.

xyOrd[["idLength"]] <- xyOrdDT[,list(V1=.N),by=groups]
                                                     ~^~

R/plotting-helpers.R:2642:1: style: Variable or function name should be lowerCamelCase.

thin.default <- function(x, tolerance, returnMatrix, minCoordsToThin) {
^~~~~~~~~~~~

R/plotting-helpers.R:2689:5: style: Variable or function name should be lowerCamelCase.

Polygons <- rep(rep(seq(numPolygons), numPolygon), idLength$V1)
    ^~~~~~~~

R/plotting-helpers.R:2690:5: style: Variable or function name should be lowerCamelCase.

Polygon <- rep(unlist(lapply(numPolygon, seq)), idLength$V1)
    ^~~~~~~

R/plotting-helpers.R:2697:36: style: Commas should always have a space after.

return(data.frame(lat = xyOrd[,1], long = xyOrd[,2], order = orders,
                                   ^

R/plotting-helpers.R:2697:54: style: Commas should always have a space after.

return(data.frame(lat = xyOrd[,1], long = xyOrd[,2], order = orders,
                                                     ^

R/plotting-helpers.R:2699:1: style: Lines should not be more than 100 characters.

#group = paste0(as.character(Polygons), ".", as.character(Polygon)))) # the actual fortify
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2702:29: style: Commas should always have a space after.

out <- cbind(x = xyOrd[,1], y = xyOrd[,2], groups = groups)
                            ^

R/plotting-helpers.R:2702:44: style: Commas should always have a space after.

out <- cbind(x = xyOrd[,1], y = xyOrd[,2], groups = groups)
                                           ^

R/plotting-other.R:199:48: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                              ~^~~

R/plotting-other.R:199:51: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                                 ~^~~

tests/testthat/test-Plot-nonVisual.R:65:21: style: Commented code should be removed.

​  library(raster); #on.exit(detach("package:raster"), add = TRUE)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-Plot-nonVisual.R:70:3: style: Variable or function name should be lowerCamelCase.

N <- ncol * nrow
  ^
@lintr-bot

This comment has been minimized.

lintr-bot commented on 565b688 Mar 23, 2018

R/plotting-colours.R:89:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:89:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:89:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:89:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:106:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:106:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:106:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:106:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:131:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:131:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:131:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:131:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:283:67: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                 ~^~~

R/plotting-colours.R:283:70: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                    ~^~~

R/plotting-helpers.R:1269:33: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                               ~^~~

R/plotting-helpers.R:1269:36: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                                  ~^~~

R/plotting-helpers.R:1358:1: style: Lines should not be more than 100 characters.

​    grid.rect(x = 0, height = unit(1 + needsNewTitle * inherits(grobToPlot, "Raster") * 0.20 / (nRows / 2), "npc"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2503:1: style: Lines should not be more than 100 characters.

#'          jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxY - minY) + minY, decreasing = TRUE)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2578:1: style: Lines should not be more than 100 characters.

thin.SpatialPolygons <- function(x, tolerance = NULL, returnDataFrame = FALSE, minCoordsToThin = 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2578:1: style: Variable or function name should be lowerCamelCase.

thin.SpatialPolygons <- function(x, tolerance = NULL, returnDataFrame = FALSE, minCoordsToThin = 0) {
^~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2594:48: style: Commas should always have a space after.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                               ^

R/plotting-helpers.R:2594:55: style: Put spaces around all infix operators.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                                     ~^~

R/plotting-helpers.R:2594:60: style: Commas should always have a space after.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                                           ^

R/plotting-helpers.R:2594:62: style: Put spaces around all infix operators.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                                            ~^~

R/plotting-helpers.R:2641:1: style: Variable or function name should be lowerCamelCase.

thin.default <- function(x, tolerance, returnDataFrame, minCoordsToThin) {
^~~~~~~~~~~~

R/plotting-helpers.R:2665:3: style: Variable or function name should be lowerCamelCase.

IDs <- tryCatch(unlist(lapply(1:length(x), function(xx) {
  ^~~

R/plotting-helpers.R:2693:7: style: Commented code should be removed.

# Polygons <- rep(rep(seq(numPolygons), numPolygon), idLength$V1) # sequential numbering
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2694:5: style: Variable or function name should be lowerCamelCase.

Polygons <- rep(rep(IDs, numPolygon), idLength$V1) # actual ID labelling
    ^~~~~~~~

R/plotting-helpers.R:2695:5: style: Variable or function name should be lowerCamelCase.

Polygon <- rep(unlist(lapply(numPolygon, seq)), idLength$V1)
    ^~~~~~~

R/plotting-helpers.R:2702:36: style: Commas should always have a space after.

return(data.frame(lat = xyOrd[,1], long = xyOrd[,2], order = orders,
                                   ^

R/plotting-helpers.R:2702:54: style: Commas should always have a space after.

return(data.frame(lat = xyOrd[,1], long = xyOrd[,2], order = orders,
                                                     ^

R/plotting-helpers.R:2704:1: style: Lines should not be more than 100 characters.

#group = paste0(as.character(Polygons), ".", as.character(Polygon)))) # the actual fortify
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2707:29: style: Commas should always have a space after.

out <- cbind(x = xyOrd[,1], y = xyOrd[,2], groups = groups)
                            ^

R/plotting-helpers.R:2707:44: style: Commas should always have a space after.

out <- cbind(x = xyOrd[,1], y = xyOrd[,2], groups = groups)
                                           ^

R/plotting-other.R:199:48: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                              ~^~~

R/plotting-other.R:199:51: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                                 ~^~~

tests/testthat/test-examples.R:9:48: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (grepl("VIC-", Sys.info()["nodename"])) { # for debugging only
                                               ^

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

#browser()
     ^~~~~~~~~

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

​    expect_true(length(warn)==0)
                           ~^~~

tests/testthat/test-Plot-nonVisual.R:65:21: style: Commented code should be removed.

​  library(raster); #on.exit(detach("package:raster"), add = TRUE)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-Plot-nonVisual.R:70:3: style: Variable or function name should be lowerCamelCase.

N <- ncol * nrow
  ^

eliotmcintire added some commits Mar 26, 2018

thin fixes -- bugfixes, SpatialPolygonsDataFrames
thin fixes -- bugfixes, SpatialPolygonsDataFrames
@lintr-bot

This comment has been minimized.

lintr-bot commented on 4b647f7 Mar 26, 2018

R/plotting-colours.R:89:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:89:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:89:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:89:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:106:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:106:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:106:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:106:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:131:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:131:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:131:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:131:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:283:67: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                 ~^~~

R/plotting-colours.R:283:70: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                    ~^~~

R/plotting-helpers.R:1269:33: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                               ~^~~

R/plotting-helpers.R:1269:36: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                                  ~^~~

R/plotting-helpers.R:1358:1: style: Lines should not be more than 100 characters.

​    grid.rect(x = 0, height = unit(1 + needsNewTitle * inherits(grobToPlot, "Raster") * 0.20 / (nRows / 2), "npc"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2503:1: style: Lines should not be more than 100 characters.

#'          jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxY - minY) + minY, decreasing = TRUE)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2578:1: style: Lines should not be more than 100 characters.

thin.SpatialPolygons <- function(x, tolerance = NULL, returnDataFrame = FALSE, minCoordsToThin = 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2578:1: style: Variable or function name should be lowerCamelCase.

thin.SpatialPolygons <- function(x, tolerance = NULL, returnDataFrame = FALSE, minCoordsToThin = 0) {
^~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2594:48: style: Commas should always have a space after.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                               ^

R/plotting-helpers.R:2594:55: style: Put spaces around all infix operators.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                                     ~^~

R/plotting-helpers.R:2594:60: style: Commas should always have a space after.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                                           ^

R/plotting-helpers.R:2594:62: style: Put spaces around all infix operators.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                                            ~^~

R/plotting-helpers.R:2643:1: style: Variable or function name should be lowerCamelCase.

thin.default <- function(x, tolerance, returnDataFrame, minCoordsToThin) {
^~~~~~~~~~~~

R/plotting-helpers.R:2668:3: style: Variable or function name should be lowerCamelCase.

IDs <- tryCatch(unlist(lapply(ord, function(xx) {
  ^~~

R/plotting-helpers.R:2696:7: style: Commented code should be removed.

# Polygons <- rep(rep(seq(numPolygons), numPolygon), idLength$V1) # sequential numbering
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2697:5: style: Variable or function name should be lowerCamelCase.

Polygons <- rep(rep(IDs, numPolygon), idLength$V1) # actual ID labelling
    ^~~~~~~~

R/plotting-helpers.R:2698:5: style: Variable or function name should be lowerCamelCase.

Polygon <- rep(unlist(lapply(numPolygon, seq)), idLength$V1)
    ^~~~~~~

R/plotting-helpers.R:2705:36: style: Commas should always have a space after.

return(data.frame(lat = xyOrd[,1], long = xyOrd[,2], order = orders,
                                   ^

R/plotting-helpers.R:2705:54: style: Commas should always have a space after.

return(data.frame(lat = xyOrd[,1], long = xyOrd[,2], order = orders,
                                                     ^

R/plotting-helpers.R:2707:1: style: Lines should not be more than 100 characters.

#group = paste0(as.character(Polygons), ".", as.character(Polygon)))) # the actual fortify
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2710:40: style: Commas should always have a space after.

out <- setDT(data.frame(x = xyOrd[,1], y = xyOrd[,2], groups = groups))
                                       ^

R/plotting-helpers.R:2710:55: style: Commas should always have a space after.

out <- setDT(data.frame(x = xyOrd[,1], y = xyOrd[,2], groups = groups))
                                                      ^

R/plotting-other.R:199:48: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                              ~^~~

R/plotting-other.R:199:51: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                                 ~^~~

tests/testthat/test-examples.R:9:48: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (grepl("VIC-", Sys.info()["nodename"])) { # for debugging only
                                               ^

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

#browser()
     ^~~~~~~~~

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

​    expect_true(length(warn)==0)
                           ~^~~

tests/testthat/test-Plot-nonVisual.R:65:21: style: Commented code should be removed.

​  library(raster); #on.exit(detach("package:raster"), add = TRUE)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-Plot-nonVisual.R:70:3: style: Variable or function name should be lowerCamelCase.

N <- ncol * nrow
  ^
@lintr-bot

This comment has been minimized.

lintr-bot commented on 7d025a7 Mar 27, 2018

R/plotting-colours.R:89:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:89:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:89:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:89:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:106:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:106:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:106:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:106:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:131:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:131:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:131:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:131:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:283:67: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                 ~^~~

R/plotting-colours.R:283:70: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                    ~^~~

R/plotting-helpers.R:1269:33: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                               ~^~~

R/plotting-helpers.R:1269:36: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                                  ~^~~

R/plotting-helpers.R:1358:1: style: Lines should not be more than 100 characters.

​    grid.rect(x = 0, height = unit(1 + needsNewTitle * inherits(grobToPlot, "Raster") * 0.20 / (nRows / 2), "npc"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2503:1: style: Lines should not be more than 100 characters.

#'          jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxY - minY) + minY, decreasing = TRUE)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2578:1: style: Lines should not be more than 100 characters.

thin.SpatialPolygons <- function(x, tolerance = NULL, returnDataFrame = FALSE, minCoordsToThin = 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2578:1: style: Variable or function name should be lowerCamelCase.

thin.SpatialPolygons <- function(x, tolerance = NULL, returnDataFrame = FALSE, minCoordsToThin = 0) {
^~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2594:48: style: Commas should always have a space after.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                               ^

R/plotting-helpers.R:2594:55: style: Put spaces around all infix operators.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                                     ~^~

R/plotting-helpers.R:2594:60: style: Commas should always have a space after.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                                           ^

R/plotting-helpers.R:2594:62: style: Put spaces around all infix operators.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                                            ~^~

R/plotting-helpers.R:2643:1: style: Variable or function name should be lowerCamelCase.

thin.default <- function(x, tolerance, returnDataFrame, minCoordsToThin) {
^~~~~~~~~~~~

R/plotting-helpers.R:2668:3: style: Variable or function name should be lowerCamelCase.

IDs <- tryCatch(unlist(lapply(ord, function(xx) {
  ^~~

R/plotting-helpers.R:2696:7: style: Commented code should be removed.

# Polygons <- rep(rep(seq(numPolygons), numPolygon), idLength$V1) # sequential numbering
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2697:5: style: Variable or function name should be lowerCamelCase.

Polygons <- rep(rep(IDs, numPolygon), idLength$V1) # actual ID labelling
    ^~~~~~~~

R/plotting-helpers.R:2698:5: style: Variable or function name should be lowerCamelCase.

Polygon <- rep(unlist(lapply(numPolygon, seq)), idLength$V1)
    ^~~~~~~

R/plotting-helpers.R:2705:36: style: Commas should always have a space after.

return(data.frame(lat = xyOrd[,1], long = xyOrd[,2], order = orders,
                                   ^

R/plotting-helpers.R:2705:54: style: Commas should always have a space after.

return(data.frame(lat = xyOrd[,1], long = xyOrd[,2], order = orders,
                                                     ^

R/plotting-helpers.R:2707:1: style: Lines should not be more than 100 characters.

#group = paste0(as.character(Polygons), ".", as.character(Polygon)))) # the actual fortify
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2710:40: style: Commas should always have a space after.

out <- setDT(data.frame(x = xyOrd[,1], y = xyOrd[,2], groups = groups))
                                       ^

R/plotting-helpers.R:2710:55: style: Commas should always have a space after.

out <- setDT(data.frame(x = xyOrd[,1], y = xyOrd[,2], groups = groups))
                                                      ^

R/plotting-other.R:199:48: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                              ~^~~

R/plotting-other.R:199:51: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                                 ~^~~

tests/testthat/test-examples.R:9:48: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (grepl("VIC-", Sys.info()["nodename"])) { # for debugging only
                                               ^

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

#browser()
     ^~~~~~~~~

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

​    expect_true(length(warn)==0)
                           ~^~~

tests/testthat/test-Plot-nonVisual.R:65:21: style: Commented code should be removed.

​  library(raster); #on.exit(detach("package:raster"), add = TRUE)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-Plot-nonVisual.R:70:3: style: Variable or function name should be lowerCamelCase.

N <- ncol * nrow
  ^
@lintr-bot

This comment has been minimized.

lintr-bot commented on 2de24c3 Mar 28, 2018

R/plotting-colours.R:89:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:89:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:89:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:89:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:106:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:106:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:106:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:106:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:131:1: style: Lines should not be more than 100 characters.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-colours.R:131:32: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                              ~^~~

R/plotting-colours.R:131:35: style: Put spaces around all infix operators.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                 ~^~~

R/plotting-colours.R:131:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (all(na.omit(object[])%%1==0)) { # some factor rasters are actually real number -- makes no sense
                                        ^

R/plotting-colours.R:283:67: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                 ~^~~

R/plotting-colours.R:283:70: style: Put spaces around all infix operators.

isFac <- any(raster::is.factor(grobToPlot)) & all(grobToPlot[]%%1==0)
                                                                    ~^~~

R/plotting-helpers.R:1269:33: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                               ~^~~

R/plotting-helpers.R:1269:36: style: Put spaces around all infix operators.

if (all(grobToPlot[]%%1==0)) {
                                  ~^~~

R/plotting-helpers.R:1358:1: style: Lines should not be more than 100 characters.

​    grid.rect(x = 0, height = unit(1 + needsNewTitle * inherits(grobToPlot, "Raster") * 0.20 / (nRows / 2), "npc"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2503:1: style: Lines should not be more than 100 characters.

#'          jitter(sort(rbeta(nPoints, betaPar, betaPar) * (maxY - minY) + minY, decreasing = TRUE)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2578:1: style: Lines should not be more than 100 characters.

thin.SpatialPolygons <- function(x, tolerance = NULL, returnDataFrame = FALSE, minCoordsToThin = 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2578:1: style: Variable or function name should be lowerCamelCase.

thin.SpatialPolygons <- function(x, tolerance = NULL, returnDataFrame = FALSE, minCoordsToThin = 0) {
^~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2594:48: style: Commas should always have a space after.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                               ^

R/plotting-helpers.R:2594:55: style: Put spaces around all infix operators.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                                     ~^~

R/plotting-helpers.R:2594:60: style: Commas should always have a space after.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                                           ^

R/plotting-helpers.R:2594:62: style: Put spaces around all infix operators.

xyOrd[["idLength"]] <- xyOrd[["out"]][,list(V1=.N),by=groups]
                                                            ~^~

R/plotting-helpers.R:2643:1: style: Variable or function name should be lowerCamelCase.

thin.default <- function(x, tolerance, returnDataFrame, minCoordsToThin) {
^~~~~~~~~~~~

R/plotting-helpers.R:2669:3: style: Variable or function name should be lowerCamelCase.

IDs <- tryCatch(unlist(lapply(ordSeq, function(xx) {
  ^~~

R/plotting-helpers.R:2697:7: style: Commented code should be removed.

# Polygons <- rep(rep(seq(numPolygons), numPolygon), idLength$V1) # sequential numbering
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2698:5: style: Variable or function name should be lowerCamelCase.

Polygons <- rep(rep(IDs, numPolygon), idLength$V1) # actual ID labelling
    ^~~~~~~~

R/plotting-helpers.R:2699:5: style: Variable or function name should be lowerCamelCase.

Polygon <- rep(unlist(lapply(numPolygon, seq)), idLength$V1)
    ^~~~~~~

R/plotting-helpers.R:2706:36: style: Commas should always have a space after.

return(data.frame(lat = xyOrd[,1], long = xyOrd[,2], order = orders,
                                   ^

R/plotting-helpers.R:2706:54: style: Commas should always have a space after.

return(data.frame(lat = xyOrd[,1], long = xyOrd[,2], order = orders,
                                                     ^

R/plotting-helpers.R:2708:1: style: Lines should not be more than 100 characters.

#group = paste0(as.character(Polygons), ".", as.character(Polygon)))) # the actual fortify
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2711:40: style: Commas should always have a space after.

out <- setDT(data.frame(x = xyOrd[,1], y = xyOrd[,2], groups = groups))
                                       ^

R/plotting-helpers.R:2711:55: style: Commas should always have a space after.

out <- setDT(data.frame(x = xyOrd[,1], y = xyOrd[,2], groups = groups))
                                                      ^

R/plotting-other.R:199:48: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                              ~^~~

R/plotting-other.R:199:51: style: Put spaces around all infix operators.

if (any(raster::is.factor(ras1)) & all(ras1[]%%1==0)) {
                                                 ~^~~

tests/testthat/test-examples.R:9:48: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (grepl("VIC-", Sys.info()["nodename"])) { # for debugging only
                                               ^

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

#browser()
     ^~~~~~~~~

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

​    expect_true(length(warn)==0)
                           ~^~~

tests/testthat/test-Plot-nonVisual.R:65:21: style: Commented code should be removed.

​  library(raster); #on.exit(detach("package:raster"), add = TRUE)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-Plot-nonVisual.R:70:3: style: Variable or function name should be lowerCamelCase.

N <- ncol * nrow
  ^

@eliotmcintire eliotmcintire merged commit 4d26fdd into PredictiveEcology:master Apr 25, 2018

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment