Skip to content

Commit

Permalink
add note re: #10
Browse files Browse the repository at this point in the history
  • Loading branch information
achubaty committed Mar 26, 2019
1 parent c1596b7 commit 00c5427
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/maps.R
Expand Up @@ -410,7 +410,7 @@ loadkNNSpeciesLayers <- function(dPath, rasterToMatch, studyArea, sppEquiv,
userTags = dots$userTags
),
prepInputs, quick = TRUE) # don't need to digest all the "targetFile" and "archives"
names(speciesLayers) <- unique(kNNnames)
names(speciesLayers) <- unique(kNNnames) ## TODO: see #10
noDataLayers <- sapply(speciesLayers, function(x) if (maxValue(x) < thresh ) FALSE else TRUE)
if (sum(!noDataLayers) > 0) {
sppKeep <- capture.output(dput(names(speciesLayers)[noDataLayers]))
Expand Down

1 comment on commit 00c5427

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/assertions.R:21:1: style: Lines should not be more than 100 characters.

onlyExistingCodes <- all(unique(cohortData34to36$ecoregionGroup) %in% unique(cohortData$initialEcoregionCode))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/assertions.R:33:23: style: Do not place spaces around code in parentheses or square brackets.

obj <- cohortData[ , .N, by = columns]
                      ^

R/assertions.R:33:24: style: Commas should never have a space before.

obj <- cohortData[ , .N, by = columns]
                      ~^

R/assertions.R:53:1: style: Lines should not be more than 100 characters.

erg[[1]] <- sort(na.omit(unique(factorValues2(ecoregionMap, ecoregionMap[], att = "ecoregionGroup"))))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/assertions.R:61:46: style: Put spaces around all infix operators.

lens <- sapply(erg, function(x) length(x)>1)
                                            ~^~

R/assertions.R:88:56: style: Commas should always have a space after.

​      stop("obj should be a data.table with at least ",NROW(colNames)," columns: ",
                                                       ^

R/assertions.R:88:71: style: Commas should always have a space after.

​      stop("obj should be a data.table with at least ",NROW(colNames)," columns: ",
                                                                      ^

R/assertions.R:114:1: style: Lines should not be more than 100 characters.

test1 <- sum(!a %in% b)  # can be 1 because there could be pixelGroup of 0, which is OK to not match
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/assertions.R:115:1: style: Lines should not be more than 100 characters.

test2 <- sum(!b %in% a)  # can be 1 because there could be pixelGroup of 0, which is OK to not match
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/assertions.R:122:1: style: Lines should not be more than 100 characters.

if (test1 > maxExpectedNumDiverge) message("test1 is ", test1, " -- too many pixelGroups on pixelGroupMap")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/assertions.R:123:1: style: Lines should not be more than 100 characters.

if (test2 > maxExpectedNumDiverge) message("test2 is ", test2, " -- too many pixelGroups in cohortData")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/assertions.R:124:1: style: Lines should not be more than 100 characters.

​      stop("The sim$pixelGroupMap and cohortData have unmatching pixelGroup. They must be matching.",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/assertions.R:157:1: style: Lines should not be more than 100 characters.

test3 <- identical(as.integer(pixelsOnMap - (lenBurnedPixels - pixelsRegeneratedOnZeros)), lenUniquePixelsInCohorts)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/assertions.R:163:1: style: Lines should not be more than 100 characters.

" This test is failing, i.e., there are some pixelGroups in pixelGroupMap that aren't in pixelCohortData.")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cleanLandWebStudyArea.R:50:1: style: Lines should not be more than 100 characters.

if (length(na.omit(pmatch(c("ANC", "DMI", "LandWeb", "LP", "MPB", "testing", "tolko"), type))))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:46:1: style: Lines should not be more than 100 characters.

#' @param treedFirePixelTableSinceLastDisp A data.table with at least 2 columns, \code{pixelIndex} and \code{pixelGroup}.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:66:48: style: Variable and function names should not be longer than 30 characters.

speciesEcoregion, treedFirePixelTableSinceLastDisp = NULL,
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:87:1: style: Lines should not be more than 100 characters.

​      message(crayon::green("  Regenerating only open pixels (e.g., likely resprouting & serotiny only)"))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

columnsForPG <- c("ecoregionGroup", "speciesCode", "age") # no Biomass because they all have zero
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:89:31: style: Commas should always have a space after.

cd <- newPixelCohortData[,c("pixelIndex", columnsForPG), with = FALSE]
                              ^

R/cohorts.R:113:20: style: Commas should always have a space after.

cd <- cohorts[,c("pixelIndex", columnsForPG), with = FALSE]
                   ^

R/cohorts.R:118:30: style: Do not place spaces around code in parentheses or square brackets.

allCohortData <- cohorts[ , .(ecoregionGroup = ecoregionGroup[1],
                             ^

R/cohorts.R:118:31: style: Commas should never have a space before.

allCohortData <- cohorts[ , .(ecoregionGroup = ecoregionGroup[1],
                             ~^

R/cohorts.R:143:5: style: Commented code should be removed.

# newPixelCohortData[, sumB := sum(B, na.rm = TRUE), by = pixelGroup]
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:215:3: style: Variable or function name should be lowerCamelCase.

specieseco_current <- speciesEcoregionLatestYear(speciesEcoregion, time)
  ^~~~~~~~~~~~~~~~~~

R/cohorts.R:216:3: style: Variable or function name should be lowerCamelCase.

specieseco_current <- setkey(specieseco_current[, .(speciesCode, maxANPP, maxB, ecoregionGroup)],
  ^~~~~~~~~~~~~~~~~~

R/cohorts.R:221:1: style: Lines should not be more than 100 characters.

# missingNewPixelCohortData <- newPixelCohortData[!specieseco_current, on = uniqueSpeciesEcoregionDefinition]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:221:5: style: Commented code should be removed.

# missingNewPixelCohortData <- newPixelCohortData[!specieseco_current, on = uniqueSpeciesEcoregionDefinition]
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:222:3: style: Variable or function name should be lowerCamelCase.

specieseco_current <- specieseco_current[!is.na(maxB)]
  ^~~~~~~~~~~~~~~~~~

R/cohorts.R:223:24: style: Variable or function name should be lowerCamelCase.

specieseco_current[, maxB_eco := max(maxB), by = ecoregionGroup]
                       ^~~~~~~~

R/cohorts.R:224:1: style: Lines should not be more than 100 characters.

newPixelCohortData <- specieseco_current[newPixelCohortData, on = uniqueSpeciesEcoregionDefinition]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:226:1: style: Lines should not be more than 100 characters.

# newPixelCohortData <- newPixelCohortData[specieseco_current, on = uniqueSpeciesEcoregionDefinition,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:228:1: style: Lines should not be more than 100 characters.

#newPixelCohortData <- setkey(newPixelCohortData, speciesCode, ecoregionGroup)[specieseco_current, nomatch = 0]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:228:4: style: Commented code should be removed.

#newPixelCohortData <- setkey(newPixelCohortData, speciesCode, ecoregionGroup)[specieseco_current, nomatch = 0]
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:233:26: style: Variable or function name should be lowerCamelCase.

newPixelCohortData[, B := NULL]
                         ^

R/cohorts.R:237:1: style: Lines should not be more than 100 characters.

​  set(newPixelCohortData, NULL, "B", as.integer(pmin(newPixelCohortData$maxANPP, newPixelCohortData$B)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:273:1: style: Lines should not be more than 100 characters.

pgsStillInCDGoneFromPGM <- cohortData[whPgsStillInCDGoneFromPGM,] #setdiff(unique(cohortData$pixelGroup), unique(pgmVals$pixelGroup))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:273:67: style: Commas should always have a space after.

pgsStillInCDGoneFromPGM <- cohortData[whPgsStillInCDGoneFromPGM,] #setdiff(unique(cohortData$pixelGroup), unique(pgmVals$pixelGroup))
                                                                  ^

R/cohorts.R:273:70: style: Commented code should be removed.

pgsStillInCDGoneFromPGM <- cohortData[whPgsStillInCDGoneFromPGM,] #setdiff(unique(cohortData$pixelGroup), unique(pgmVals$pixelGroup))
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:274:4: style: Commented code should be removed.

#pgsStillInPGMGoneFromCD <- setdiff(unique(pgmVals$pixelGroup), unique(cohortData$pixelGroup))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:276:64: style: Commas should always have a space after.

pgsStillInPGMGoneFromCD <- pgmVals[whPgsStillInPGMGoneFromCD,]
                                                               ^

R/cohorts.R:328:7: style: Do not place spaces around code in parentheses or square brackets.

pcd[ , c(columns2) := lapply(.SD, function(x) {
      ^

R/cohorts.R:328:8: style: Commas should never have a space before.

pcd[ , c(columns2) := lapply(.SD, function(x) {
      ~^

R/cohorts.R:332:1: style: Lines should not be more than 100 characters.

# concatenate within rows -- e.g., ecoregionCode_speciesCode_age_biomass or 647_11_Abie_sp_100_2000
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:338:1: style: Lines should not be more than 100 characters.

pcd[ , c("uniqueComboByPixelIndex") := paste(uniqueComboByRow, collapse = "__"), by = "pixelIndex"]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:338:7: style: Do not place spaces around code in parentheses or square brackets.

pcd[ , c("uniqueComboByPixelIndex") := paste(uniqueComboByRow, collapse = "__"), by = "pixelIndex"]
      ^

R/cohorts.R:338:8: style: Commas should never have a space before.

pcd[ , c("uniqueComboByPixelIndex") := paste(uniqueComboByRow, collapse = "__"), by = "pixelIndex"]
      ~^

R/cohorts.R:339:7: style: Do not place spaces around code in parentheses or square brackets.

pcd[ , c("pixelGroup") := as.integer(maxPixelGroup) + as.integer(factor(uniqueComboByPixelIndex))]
      ^

R/cohorts.R:339:8: style: Commas should never have a space before.

pcd[ , c("pixelGroup") := as.integer(maxPixelGroup) + as.integer(factor(uniqueComboByPixelIndex))]
      ~^

R/cohorts.R:378:1: style: Variable and function names should not be longer than 30 characters.

uniqueSpeciesEcoregionDefinition <- c("speciesCode", "ecoregionGroup")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:390:1: style: Lines should not be more than 100 characters.

​  message(magenta("Pixels with non-NA cover:, ", cohortData[!is.na(cover), length(unique(pixelIndex))]))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:398:86: style: Put spaces around all infix operators.

pixelsZero <- NROW(cohortData[, all(get(val) == 0), by = "pixelIndex"][get("V1") ==TRUE])
                                                                                     ^~~

R/cohorts.R:399:40: style: Commas should always have a space after.

​    message(magenta("Pixels with all(",val," == 0): ", format(pixelsZero, big.mark = ",")))
                                       ^

R/cohorts.R:399:44: style: Commas should always have a space after.

​    message(magenta("Pixels with all(",val," == 0): ", format(pixelsZero, big.mark = ",")))
                                           ^

R/cohorts.R:400:1: style: Lines should not be more than 100 characters.

pixelsBiomassNonZero <- NROW(cohortData[, any(get(val) > 0), by = "pixelIndex"][get("V1") ==TRUE])
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:400:95: style: Put spaces around all infix operators.

pixelsBiomassNonZero <- NROW(cohortData[, any(get(val) > 0), by = "pixelIndex"][get("V1") ==TRUE])
                                                                                              ^~~

R/cohorts.R:401:40: style: Commas should always have a space after.

​    message(magenta("Pixels with all(",val," > 0): ", format(pixelsBiomassNonZero, big.mark = ",")))
                                       ^

R/cohorts.R:401:44: style: Commas should always have a space after.

​    message(magenta("Pixels with all(",val," > 0): ", format(pixelsBiomassNonZero, big.mark = ",")))
                                           ^

R/cohorts.R:402:1: style: Lines should not be more than 100 characters.

out <- list(pixelsNA = pixelsNA, pixelsZero = pixelsZero, pixelsBiomassNonZero = pixelsBiomassNonZero)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:437:32: style: Variable or function name should be lowerCamelCase.

availableERC_by_Sp) {
                               ^~~~~~~~~~~~~~~~~~

R/cohorts.R:445:4: style: Commented code should be removed.

#cdEcoregionCodes <- as.character(unique(pixelCohortData$initialEcoregionCode))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:446:4: style: Commented code should be removed.

#availableERC_by_Sp <- unique(pixelCohortData, by = c("initialEcoregionCode", "speciesCode", "B"))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:447:4: style: Commented code should be removed.

#availableERC_by_Sp <- availableERC_by_Sp[eval(rowsInPCDToKeep)]
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:448:4: style: Commented code should be removed.

#availableERC_by_Sp <- unique(availableERC_by_Sp, by = c("initialEcoregionCode", "speciesCode"))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:452:6: style: Commented code should be removed.

#theUnwantedCellsFromCD <- unique(pixelCohortData[lcc %in% pixelClassesToReplace]$pixelIndex)
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:453:6: style: Commented code should be removed.

#iden <- identical(sort(unique(theUnwantedPixels)), sort(theUnwantedCellsFromCD))
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:455:8: style: Commented code should be removed.

#  stop("values of 34 and 35 on pixelCohortData and sim$LCC2005 don't match")
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:460:5: style: Commented code should be removed.

# availableERC_by_Sp[, initialEcoregionCode := NULL]
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:463:5: style: Commented code should be removed.

# cd <- pixelCohortData[, .(pixelIndex, initialEcoregionCode, speciesCode)]
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:470:1: style: Lines should not be more than 100 characters.

out <- out[initialPixels != pixels] # rm pixels which are same as initialPixels --> these are known wrong
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:473:1: style: Lines should not be more than 100 characters.

# out <- unique(availableERC_by_Sp)[out, on = c("pixelIndex" = "pixels"), nomatch = 0] # join the availableERC_by_Sp which has initialEcoregionCode
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:473:7: style: Commented code should be removed.

# out <- unique(availableERC_by_Sp)[out, on = c("pixelIndex" = "pixels"), nomatch = 0] # join the availableERC_by_Sp which has initialEcoregionCode
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:474:47: style: Put spaces around all infix operators.

out[lcc %in% c(pixelClassesToReplace), lcc:=NA]
                                             ~^~~

R/cohorts.R:476:7: style: Commented code should be removed.

# out[, `:=`(potentialNewERG = ecoregionGroupVec[pixels])]
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:477:1: style: Lines should not be more than 100 characters.

# attach speciesCode -- need this so that we know which speciesCodes to test against speciesEcoregion
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:478:1: style: Lines should not be more than 100 characters.

# a <- out[availableERC_by_Sp, allow.cartesian = TRUE, on = c("initialPixels" = "pixelIndex"), nomatch = NA]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:478:7: style: Commented code should be removed.

# a <- out[availableERC_by_Sp, allow.cartesian = TRUE, on = c("initialPixels" = "pixelIndex"), nomatch = NA]
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:480:1: style: Lines should not be more than 100 characters.

on = c("pixelIndex" = "initialPixels"), nomatch = NA] # join the availableERC_by_Sp which has initialEcoregionCode
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:482:1: style: Lines should not be more than 100 characters.

out5[, possERC := paste0(ecoregion, "_", paddedFloatToChar(as.numeric(lcc), padL = 2, padR = 0))]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:483:1: style: Lines should not be more than 100 characters.

out7 <- out5[availableERG2, on = c("speciesCode", "possERC" = "initialEcoregionCode"), nomatch = NA]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:503:1: style: Lines should not be more than 100 characters.

rowsToKeep <- out6[, list(keep = .resample(.I, 1)), by = c("pixelIndex")] # random sample of available, weighted by abundance
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:508:8: style: Commented code should be removed.

#out2 <- out2[rowsToKeep$keep]
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:510:1: style: Lines should not be more than 100 characters.

​                                      paddedFloatToChar(as.numeric(newPossLCC), padL = 2, padR = 0))]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:513:1: style: Lines should not be more than 100 characters.

# remove combinations of ecoregionGroup and speciesCode that don't exist -- Now this excludes B = 0
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:514:1: style: Lines should not be more than 100 characters.

#out2 <- availableERC_by_Sp[out2, on = c("pixelIndex" = "initialPixels", "initialEcoregionCode" = "ecoregionGroup", "speciesCode"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:516:1: style: Lines should not be more than 100 characters.

#hasMatch <- out2[, all(!is.na(rasterToMatch)), by = c("pixelIndex", "initialEcoregionCode", "speciesCode")][V1 == TRUE]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:516:8: style: Commented code should be removed.

#hasMatch <- out2[, all(!is.na(rasterToMatch)), by = c("pixelIndex", "initialEcoregionCode", "speciesCode")][V1 == TRUE]
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:518:1: style: Lines should not be more than 100 characters.

# out2 <- out2[ecoregionGroup %in% cdEcoregionCodes] # remove codes that don't exist in pixelCohortData
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:518:9: style: Commented code should be removed.

# out2 <- out2[ecoregionGroup %in% cdEcoregionCodes] # remove codes that don't exist in pixelCohortData
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:534:7: style: Commented code should be removed.

# setnames(out3, c("initialPixels", "initialEcoregionCode"), c("pixelIndex", "ecoregionGroup"))
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:536:7: style: Commented code should be removed.

# out3 <- unique(out3, by = c("pixelIndex", "ecoregionGroup"))
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:593:6: style: Commented code should be removed.

#describeCohortData(cohortData)
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:601:16: style: Variable or function name should be lowerCamelCase.

cohortData[, V1 := NULL]
               ^~

R/cohorts.R:606:5: style: Commented code should be removed.

# cohortData[speciesCode == "Popu_sp", cover := asInteger(cover / 2)]
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:607:14: style: Do not place spaces around code in parentheses or square brackets.

cohortData[ , cover := {
             ^

R/cohorts.R:607:15: style: Commas should never have a space before.

cohortData[ , cover := {
             ~^

R/cohorts.R:610:31: style: Put spaces around all infix operators.

cover <- asInteger(cover/(sumCover + 0.0001) * 100L)
                             ~^~

R/cohorts.R:610:32: style: Place a space before left parenthesis, except in a function call.

cover <- asInteger(cover/(sumCover + 0.0001) * 100L)
                               ^

R/cohorts.R:617:1: style: Lines should not be more than 100 characters.

cohortData[ , B := asInteger(mean(totalBiomass) * cover / 100), by = "pixelIndex"] # /100 because cover is percent
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:617:14: style: Do not place spaces around code in parentheses or square brackets.

cohortData[ , B := asInteger(mean(totalBiomass) * cover / 100), by = "pixelIndex"] # /100 because cover is percent
             ^

R/cohorts.R:617:15: style: Commas should never have a space before.

cohortData[ , B := asInteger(mean(totalBiomass) * cover / 100), by = "pixelIndex"] # /100 because cover is percent
             ~^

R/cohorts.R:617:17: style: Variable or function name should be lowerCamelCase.

cohortData[ , B := asInteger(mean(totalBiomass) * cover / 100), by = "pixelIndex"] # /100 because cover is percent
                ^

R/cohorts.R:619:14: style: Do not place spaces around code in parentheses or square brackets.

cohortData[ , B := asInteger(ceiling(B / pixelGroupBiomassClass) *
             ^

R/cohorts.R:619:15: style: Commas should never have a space before.

cohortData[ , B := asInteger(ceiling(B / pixelGroupBiomassClass) *
             ~^

R/cohorts.R:619:17: style: Variable or function name should be lowerCamelCase.

cohortData[ , B := asInteger(ceiling(B / pixelGroupBiomassClass) *
                ^

R/cohorts.R:622:14: style: Do not place spaces around code in parentheses or square brackets.

cohortData[ , totalBiomass := asInteger(totalBiomass)]
             ^

R/cohorts.R:622:15: style: Commas should never have a space before.

cohortData[ , totalBiomass := asInteger(totalBiomass)]
             ~^

R/cohorts.R:641:1: style: Lines should not be more than 100 characters.

uniqueEcoregionGroup = unique(cohortDataMissingAgeUnique$ecoregionGroup),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:656:1: style: Lines should not be more than 100 characters.

​  message(blue("Set recalculate totalBiomass as sum(B); many biomasses will have been set to 0 in previous steps"))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:657:36: style: Variable or function name should be lowerCamelCase.

cohortData[cover > 0 & age == 0, B := 0L]
                                   ^

R/cohorts.R:663:5: style: Commented code should be removed.

# cohortData[ , coverProp := (cover/100 * (NROW(cohortData) - 1) + 0.5) / NROW(cohortData)]
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cohorts.R:679:1: style: Lines should not be more than 100 characters.

#'   is the basis for the statistics, and can be used to optimize caching, e.g. ignore \code{.specialData} in .omitArgs
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/LANDIS-II-tables.R:113:1: style: Lines should not be more than 100 characters.

#' \url{https://github.com/LANDIS-II-Foundation/Extensions-Succession/master/biomass-succession-archive/trunk/tests/v6.0-2.0/biomass-succession_test.txt"}).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/LANDIS-II-tables.R:133:17: style: Commented code should be removed.

maxcol <- 13 #max(count.fields(file.path(dPath, "species.txt"), sep = ""))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/LANDIS-II-tables.R:154:13: style: Only use double-quotes.

species[, ':='(seeddistance_eff = gsub(",", "", seeddistance_eff),
            ^~~~

R/LANDIS-II-tables.R:154:17: style: Place a space before left parenthesis, except in a function call.

species[, ':='(seeddistance_eff = gsub(",", "", seeddistance_eff),
                ^

R/LANDIS-II-tables.R:167:18: style: Only use double-quotes.

speciesAddon[, ':='(leaflongevity = as.numeric(leaflongevity),
                 ^~~~

R/LANDIS-II-tables.R:167:22: style: Place a space before left parenthesis, except in a function call.

speciesAddon[, ':='(leaflongevity = as.numeric(leaflongevity),
                     ^

R/LANDIS-II-tables.R:179:13: style: Only use double-quotes.

species[, ':='(species = paste0(toupper(substring(species1, 1, 1)),
            ^~~~

R/LANDIS-II-tables.R:179:17: style: Place a space before left parenthesis, except in a function call.

species[, ':='(species = paste0(toupper(substring(species1, 1, 1)),
                ^

R/LANDIS-II-tables.R:183:13: style: Only use double-quotes.

species[, ':='(species1 = NULL, species2 = NULL)]
            ^~~~

R/LANDIS-II-tables.R:183:17: style: Place a space before left parenthesis, except in a function call.

species[, ':='(species1 = NULL, species2 = NULL)]
                ^

R/LANDIS-II-tables.R:211:39: style: Commas should always have a space after.

mainInput <- mainInput[col1 != ">>",]
                                      ^

R/LANDIS-II-tables.R:221:1: style: Lines should not be more than 100 characters.

#' \url{https://github.com/LANDIS-II-Foundation/Extensions-Succession/master/biomass-succession-archive/trunk/tests/v6.0-2.0/ecoregion.txt"}).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/LANDIS-II-tables.R:238:16: style: Commented code should be removed.

maxcol <- 5 #max(count.fields(file.path(dPath, "ecoregions.txt"), sep = ""))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/LANDIS-II-tables.R:254:47: style: Commas should always have a space after.

ecoregion <- ecoregion[col1 != "LandisData",]
                                              ^

R/LANDIS-II-tables.R:255:39: style: Commas should always have a space after.

ecoregion <- ecoregion[col1 != ">>",]
                                      ^

R/LANDIS-II-tables.R:267:1: style: Lines should not be more than 100 characters.

#' \url{https://github.com/LANDIS-II-Foundation/Extensions-Succession/master/biomass-succession-archive/trunk/tests/v6.0-2.0/biomass-succession-dynamic-inputs_test.txt"}).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/LANDIS-II-tables.R:299:61: style: Commas should always have a space after.

speciesEcoregion <- speciesEcoregion[col1 != "LandisData",]
                                                            ^

R/LANDIS-II-tables.R:300:53: style: Commas should always have a space after.

speciesEcoregion <- speciesEcoregion[col1 != ">>",]
                                                    ^

R/LANDIS-II-tables.R:311:22: style: Only use double-quotes.

speciesEcoregion[, ':='(species = paste0(toupper(substring(species1, 1, 1)),
                     ^~~~

R/LANDIS-II-tables.R:311:26: style: Place a space before left parenthesis, except in a function call.

speciesEcoregion[, ':='(species = paste0(toupper(substring(species1, 1, 1)),
                         ^

R/LANDIS-II-tables.R:314:22: style: Only use double-quotes.

speciesEcoregion[, ':='(species1 = NULL, species2 = NULL)]
                     ^~~~

R/LANDIS-II-tables.R:314:26: style: Place a space before left parenthesis, except in a function call.

speciesEcoregion[, ':='(species1 = NULL, species2 = NULL)]
                         ^

R/maps.R:22:29: style: Variable or function name should be lowerCamelCase.

defineFlammable <- function(LandCoverClassifiedMap = NULL,
                            ^~~~~~~~~~~~~~~~~~~~~~

R/maps.R:129:5: style: Variable or function name should be lowerCamelCase.

MixedRas <- speciesStack[[1]]
    ^~~~~~~~

R/maps.R:133:18: style: Variable or function name should be lowerCamelCase.

speciesStack$Mixed <- MixedRas
                 ^~~~~

R/maps.R:185:1: style: Lines should not be more than 100 characters.

leading = speciesCode[which.max(speciesProportion)]), by = "pixelGroup"]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:189:1: style: Lines should not be more than 100 characters.

​  levels(vegTypeMap) <- cbind(levels(vegTypeMap)[[1]], colors = colors[match(levels(vegTypeMap)[[1]][[2]], names(colors))],
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:220:7: style: Commented code should be removed.

#   species[species == "Pice_mar", speciesGroup := "PICE_MAR"]
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:221:7: style: Commented code should be removed.

#   species[species == "Pice_gla", speciesGroup := "PICE_GLA"]
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:222:7: style: Commented code should be removed.

#   species[species == "Abie_sp", speciesGroup := "ABIE"]
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:226:7: style: Commented code should be removed.

#   shortcohortdata[, totalB := sum(B, na.rm = TRUE), by = pixelGroup]
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:230:7: style: Commented code should be removed.

#   shortcohortdata[, speciesProportion := speciesGroupB / totalB]
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:232:7: style: Commented code should be removed.

#   speciesLeading <- NULL
      ^~~~~~~~~~~~~~~~~~~~~~

R/maps.R:235:7: style: Commented code should be removed.

#   pixelGroup <- NULL
      ^~~~~~~~~~~~~~~~~~

R/maps.R:236:7: style: Commented code should be removed.

#   speciesProportion <- NULL
      ^~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:237:7: style: Commented code should be removed.

#   speciesGroup <- NULL
      ^~~~~~~~~~~~~~~~~~~~

R/maps.R:238:7: style: Commented code should be removed.

#   speciesCode <- NULL
      ^~~~~~~~~~~~~~~~~~~

R/maps.R:239:7: style: Commented code should be removed.

#   totalB <- NULL
      ^~~~~~~~~~~~~~

R/maps.R:241:7: style: Commented code should be removed.

#   speciesGroupB <- NULL
      ^~~~~~~~~~~~~~~~~~~~~

R/maps.R:251:7: style: Commented code should be removed.

#   shortcohortdata[is.na(speciesLeading), speciesLeading := 0]
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:252:7: style: Commented code should be removed.

#   shortcohortdata[, speciesLeading := max(speciesLeading, na.rm = TRUE), by = pixelGroup]
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:253:7: style: Commented code should be removed.

#   shortcohortdata <- unique(shortcohortdata[, .(pixelGroup, speciesLeading)], by = "pixelGroup")
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:254:7: style: Commented code should be removed.

#   shortcohortdata[speciesLeading == 0, speciesLeading := 5] # 5 is mixed forests
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:255:7: style: Commented code should be removed.

#   attritable <- data.table(ID = sort(unique(shortcohortdata$speciesLeading)))
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:260:7: style: Commented code should be removed.

#   attritable[ID == 5, Factor := "Mixed"]
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:261:7: style: Commented code should be removed.

#   vegTypeMap <- rasterizeReduced(shortcohortdata, pixelGroupMap, "speciesLeading", "pixelGroup")
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:262:7: style: Commented code should be removed.

#   vegTypeMap <- setValues(vegTypeMap, as.integer(getValues(vegTypeMap)))
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:263:7: style: Commented code should be removed.

#   levels(vegTypeMap) <- as.data.frame(attritable)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:264:7: style: Commented code should be removed.

#   projection(vegTypeMap) <- projection(pixelGroupMap)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:377:1: style: Lines should not be more than 100 characters.

## select which archives/targetFiles to extract -- because there was "multi" above, need unique here
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:384:1: style: Lines should not be more than 100 characters.

archive2 = file.path(dPath, paste0("NFI_MODIS250m_kNN_Species_", kNNnames, "_v0.zip")))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:387:1: style: Lines should not be more than 100 characters.

if (!all(reproducible::basename2(file_path_sans_ext(names(archives))) == file_path_sans_ext(targetFiles)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:394:1: style: Lines should not be more than 100 characters.

​    message("This looks like a lot of species; did you mean to pass only a subset of this to sppEquiv?",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:412:1: style: Lines should not be more than 100 characters.

prepInputs, quick = TRUE) # don't need to digest all the "targetFile" and "archives"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:414:77: style: Do not place spaces around code in parentheses or square brackets.

noDataLayers <- sapply(speciesLayers, function(x) if (maxValue(x) < thresh ) FALSE else TRUE)
                                                                            ^

R/maps.R:417:76: style: Commas should always have a space after.

​    message("removing ", sum(!noDataLayers), " species because they had <",thresh,
                                                                           ^

R/maps.R:419:1: style: Lines should not be more than 100 characters.

"\n  These species are retained (and could be further culled manually, if desired):\n  ",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:441:5: style: Commented code should be removed.

# layerData <- Cache(sapply, X = speciesLayers, function(x) sum(x[] > 0, na.rm = TRUE))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:443:5: style: Commented code should be removed.

# ## remove layers that had < thresh pixels with biomass
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:444:5: style: Commented code should be removed.

# belowThresh <- layerData < thresh
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:446:7: style: Commented code should be removed.

#   message(names(belowThresh)[belowThresh], " was removed because it had no data")
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:447:7: style: Commented code should be removed.

#   speciesLayers[belowThresh] <- NULL
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/maps.R:546:7: style: Variable or function name should be lowerCamelCase.

LQRastName <- basename(tempfile(fileext = ".tif"))
      ^~~~~~~~~~

R/maps.R:548:9: style: Variable or function name should be lowerCamelCase.

LQCurName <- basename(tempfile(fileext = ".tif"))
        ^~~~~~~~~

R/maps.R:555:7: style: Variable or function name should be lowerCamelCase.

LQRastInHQcrs <- projectExtent(lowQualityStack, crs = crs(highQualityStack))
      ^~~~~~~~~~~~~

R/maps.R:568:7: style: Variable or function name should be lowerCamelCase.

LQRast <- raster(LQRastName)
      ^~~~~~

R/maps.R:586:9: style: Variable or function name should be lowerCamelCase.

HQRast <- raster(tmpHQName)
        ^~~~~~

R/maps.R:591:9: style: Variable or function name should be lowerCamelCase.

HQRast <- highQualityStack[[SPP]]
        ^~~~~~

R/maps.R:594:7: style: Variable or function name should be lowerCamelCase.

LQRast <- lowQualityStack[[SPP]]
      ^~~~~~

R/maps.R:595:7: style: Variable or function name should be lowerCamelCase.

HQRast <- highQualityStack[[SPP]]
      ^~~~~~

R/maps.R:602:5: style: Variable or function name should be lowerCamelCase.

NAs <- is.na(HQRast[])
    ^~~

R/maps.R:606:5: style: Variable or function name should be lowerCamelCase.

HQRast <- writeRaster(HQRast, datatype = "INT1U",
    ^~~~~~

R/maps.R:616:7: style: Variable or function name should be lowerCamelCase.

HQRast <- highQualityStack[[SPP]]
      ^~~~~~

R/maps.R:620:7: style: Variable or function name should be lowerCamelCase.

LQRast <- lowQualityStack[[SPP]]
      ^~~~~~

R/maps.R:624:7: style: Variable or function name should be lowerCamelCase.

HQRast <- highQualityStack[[SPP]]
      ^~~~~~

R/maps.R:654:4: style: Commented code should be removed.

#names(sppMerges) <- equivalentName(names(sppMerges), sppEquiv,  column = sppEquivCol)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/misc.R:18:17: style: Do not place spaces around code in parentheses or square brackets.

newCohortData[ , lightProb := sufficientLight[cbind(shadetolerance, siteShade + 2)]]
                ^

R/misc.R:18:18: style: Commas should never have a space before.

newCohortData[ , lightProb := sufficientLight[cbind(shadetolerance, siteShade + 2)]]
                ~^

R/misc.R:43:1: style: Trailing blank lines are superfluous.

^

Please sign in to comment.