Permalink
Browse files

bugfix for environments that don't act like environments

  • Loading branch information...
eliotmcintire committed Oct 11, 2018
1 parent b8f488a commit 1c701e1b7d1586e27d7164e4cfa9aacc920d51fb
Showing with 9 additions and 4 deletions.
  1. +2 −2 DESCRIPTION
  2. +7 −2 R/plotting-helpers.R
View
@@ -8,8 +8,8 @@ Description: A high-level plotting system, built using 'grid' graphics, that is
URL:
http://quickplot.predictiveecology.org,
https://github.com/PredictiveEcology/quickPlot
Version: 0.1.5.9000
Date: 2018-10-01
Version: 0.1.5.9001
Date: 2018-10-15
Authors@R: c(
person("Eliot J B", "McIntire", email = "eliot.mcintire@canada.ca",
role = c("aut", "cre"), comment=c(ORCID = "https://orcid.org/0000-0002-6914-8316")),
View
@@ -818,11 +818,16 @@ setMethod(
.[[length(.)]]
inGlobal <- identical(envs, .GlobalEnv)
if (is.environment(eval(parse(text = deparsedTxt), envir = envs))) {
envs <- eval(parse(text = deparsedTxt), envir = envs)
possEnv <- eval(parse(text = deparsedTxt), envir = envs)
if (is.environment(possEnv)) {
notPoss <- tryCatch(get(deparse(rev(elems)[[1]]), envir = possEnv), error = function(x) FALSE)
if (!isFALSE(notPoss))
envs <- possEnv
} else {
if (!lastOneDone) elems[[i]] <- parseTxt
}
if (exists("callEnv", inherits = FALSE)) {
envs <- callEnv
}

1 comment on commit 1c701e1

@lintr-bot

This comment has been minimized.

Show comment
Hide comment
@lintr-bot

lintr-bot Oct 11, 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:287:35: style: Put spaces around all infix operators.

if (all(na.omit(grobToPlot[]%%1)==0))
                                 ~^~~

R/plotting-colours.R:287:39: style: Put spaces around all infix operators.

if (all(na.omit(grobToPlot[]%%1)==0))
                                     ~^~~

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

grobToPlot <- grobToPlot[polySeq,]
                                           ^

R/plotting-helpers.R:1033:38: style: Commas should always have a space after.

grobToPlot <- grobToPlot[a[1,],]
                                     ^

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

grobToPlot <- grobToPlot[a[1,],]
                                       ^

R/plotting-helpers.R:1296:41: style: Put spaces around all infix operators.

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

R/plotting-helpers.R:1296:45: style: Put spaces around all infix operators.

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

R/plotting-helpers.R:1385: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:2516: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:2594:1: style: Variable or function name should be lowerCamelCase.

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

R/plotting-helpers.R:2615:8: style: Commented code should be removed.

#xyOrd[["out"]] <- xyOrd[["out"]][thinRes, ]# thin line
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2638:50: style: Commas should always have a space after.

dat <- x@data[as.numeric(names1) + 1,]
                                                 ^

R/plotting-helpers.R:2639:14: style: Commented code should be removed.

#row.names(dat) <- as.character(seq_len(length(xyOrd)))
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

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

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

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

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

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

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

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

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

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

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

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

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

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

R/plotting-helpers.R:2742: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:2745: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:2745:55: style: Commas should always have a space after.

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

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

​    which(polygon@data$Shape_Area>(sort(polygon@data$Shape_Area, decreasing = TRUE)[maxNumPolygons]))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2760:34: style: Put spaces around all infix operators.

​    which(polygon@data$Shape_Area>(sort(polygon@data$Shape_Area, decreasing = TRUE)[maxNumPolygons]))
                                ~^~

R/plotting-helpers.R:2760:35: style: Place a space before left parenthesis, except in a function call.

​    which(polygon@data$Shape_Area>(sort(polygon@data$Shape_Area, decreasing = TRUE)[maxNumPolygons]))
                                  ^

R/plotting-helpers.R:2783:26: style: Commas should always have a space after.

totalAvailable," polygons in this view. See options('quickPlot.maxNumPolygons')")
                         ^

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

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

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

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

R/plotting-other.R:251:30: style: Commas should always have a space after.

if (sum(corners$coords[1,] - corners$coords[2,]) %==% 0) {
                             ^

R/plotting-other.R:251:51: style: Commas should always have a space after.

if (sum(corners$coords[1,] - corners$coords[2,]) %==% 0) {
                                                  ^

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

if (length(row) == 0) { # above the plot
                          ^

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

if (length(column) == 0) { # above the plot
                             ^

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

if (isTRUE("tools:rstudio" %in% search())) { # runing in Rstudio
                                             ^

R/plotting.R:290:1: style: Lines should not be more than 100 characters.

isDoCall <- grepl("^do.call", scalls) & grepl("\\<Plot\\>", scalls) & !grepl("test_that", scalls)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting.R:308:6: style: Commented code should be removed.

#whFrame <- grep(scalls, pattern = "^Plot|^quickPlot::Plot")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting.R:318:8: style: Commented code should be removed.

#dotObjs <- mget(dotNames[!noName], envir = plotFrame, inherits = TRUE)
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting.R:322:1: style: Lines should not be more than 100 characters.

if (is.null(title)) plotArgs$title <- ifelse(nzchar(names(dotObjs2)), names(dotObjs2), dotNames)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Sr1 <- Polygon(coords1)
  ^~~

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

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

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

​  crs(shpEcozone) <- "+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

bb <- raster::shapefile(file.path(cacheRepo, "EC_borealdisturbance_polygonal_2008_2010_FINAL_ALBERS.shp"))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:11:15: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

​    setwd(owd)}
              ^

tests/testthat/test-Plot-do-call.R:8:3: style: Variable or function name should be lowerCamelCase.

Sr1 <- Polygon(coords1)
  ^~~

tests/testthat/test-Plot-do-call.R:9:3: style: Variable or function name should be lowerCamelCase.

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

tests/testthat/test-Plot-do-call.R:11:1: style: Lines should not be more than 100 characters.

​  crs(shpEcozone) <- "+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-Plot-do-call.R:13:24: style: Commas should always have a space after.

r <- raster(extent(0,10,0,10), res = 1, vals = 1:100)
                       ^

tests/testthat/test-Plot-do-call.R:13:27: style: Commas should always have a space after.

r <- raster(extent(0,10,0,10), res = 1, vals = 1:100)
                          ^

tests/testthat/test-Plot-do-call.R:13:29: style: Commas should always have a space after.

r <- raster(extent(0,10,0,10), res = 1, vals = 1:100)
                            ^

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 commented on 1c701e1 Oct 11, 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:287:35: style: Put spaces around all infix operators.

if (all(na.omit(grobToPlot[]%%1)==0))
                                 ~^~~

R/plotting-colours.R:287:39: style: Put spaces around all infix operators.

if (all(na.omit(grobToPlot[]%%1)==0))
                                     ~^~~

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

grobToPlot <- grobToPlot[polySeq,]
                                           ^

R/plotting-helpers.R:1033:38: style: Commas should always have a space after.

grobToPlot <- grobToPlot[a[1,],]
                                     ^

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

grobToPlot <- grobToPlot[a[1,],]
                                       ^

R/plotting-helpers.R:1296:41: style: Put spaces around all infix operators.

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

R/plotting-helpers.R:1296:45: style: Put spaces around all infix operators.

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

R/plotting-helpers.R:1385: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:2516: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:2594:1: style: Variable or function name should be lowerCamelCase.

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

R/plotting-helpers.R:2615:8: style: Commented code should be removed.

#xyOrd[["out"]] <- xyOrd[["out"]][thinRes, ]# thin line
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2638:50: style: Commas should always have a space after.

dat <- x@data[as.numeric(names1) + 1,]
                                                 ^

R/plotting-helpers.R:2639:14: style: Commented code should be removed.

#row.names(dat) <- as.character(seq_len(length(xyOrd)))
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

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

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

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

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

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

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

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

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

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

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

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

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

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

R/plotting-helpers.R:2742: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:2745: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:2745:55: style: Commas should always have a space after.

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

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

​    which(polygon@data$Shape_Area>(sort(polygon@data$Shape_Area, decreasing = TRUE)[maxNumPolygons]))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting-helpers.R:2760:34: style: Put spaces around all infix operators.

​    which(polygon@data$Shape_Area>(sort(polygon@data$Shape_Area, decreasing = TRUE)[maxNumPolygons]))
                                ~^~

R/plotting-helpers.R:2760:35: style: Place a space before left parenthesis, except in a function call.

​    which(polygon@data$Shape_Area>(sort(polygon@data$Shape_Area, decreasing = TRUE)[maxNumPolygons]))
                                  ^

R/plotting-helpers.R:2783:26: style: Commas should always have a space after.

totalAvailable," polygons in this view. See options('quickPlot.maxNumPolygons')")
                         ^

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

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

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

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

R/plotting-other.R:251:30: style: Commas should always have a space after.

if (sum(corners$coords[1,] - corners$coords[2,]) %==% 0) {
                             ^

R/plotting-other.R:251:51: style: Commas should always have a space after.

if (sum(corners$coords[1,] - corners$coords[2,]) %==% 0) {
                                                  ^

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

if (length(row) == 0) { # above the plot
                          ^

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

if (length(column) == 0) { # above the plot
                             ^

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

if (isTRUE("tools:rstudio" %in% search())) { # runing in Rstudio
                                             ^

R/plotting.R:290:1: style: Lines should not be more than 100 characters.

isDoCall <- grepl("^do.call", scalls) & grepl("\\<Plot\\>", scalls) & !grepl("test_that", scalls)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting.R:308:6: style: Commented code should be removed.

#whFrame <- grep(scalls, pattern = "^Plot|^quickPlot::Plot")
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting.R:318:8: style: Commented code should be removed.

#dotObjs <- mget(dotNames[!noName], envir = plotFrame, inherits = TRUE)
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/plotting.R:322:1: style: Lines should not be more than 100 characters.

if (is.null(title)) plotArgs$title <- ifelse(nzchar(names(dotObjs2)), names(dotObjs2), dotNames)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Sr1 <- Polygon(coords1)
  ^~~

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

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

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

​  crs(shpEcozone) <- "+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

bb <- raster::shapefile(file.path(cacheRepo, "EC_borealdisturbance_polygonal_2008_2010_FINAL_ALBERS.shp"))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-examples.R:11:15: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

​    setwd(owd)}
              ^

tests/testthat/test-Plot-do-call.R:8:3: style: Variable or function name should be lowerCamelCase.

Sr1 <- Polygon(coords1)
  ^~~

tests/testthat/test-Plot-do-call.R:9:3: style: Variable or function name should be lowerCamelCase.

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

tests/testthat/test-Plot-do-call.R:11:1: style: Lines should not be more than 100 characters.

​  crs(shpEcozone) <- "+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-Plot-do-call.R:13:24: style: Commas should always have a space after.

r <- raster(extent(0,10,0,10), res = 1, vals = 1:100)
                       ^

tests/testthat/test-Plot-do-call.R:13:27: style: Commas should always have a space after.

r <- raster(extent(0,10,0,10), res = 1, vals = 1:100)
                          ^

tests/testthat/test-Plot-do-call.R:13:29: style: Commas should always have a space after.

r <- raster(extent(0,10,0,10), res = 1, vals = 1:100)
                            ^

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
  ^
Please sign in to comment.