Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
achubaty committed Jul 15, 2020
2 parents 7447fa3 + 5552b87 commit a3944cf
Show file tree
Hide file tree
Showing 17 changed files with 117 additions and 123 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ URL:
http:https://landr.predictiveecology.org,
https://github.com/PredictiveEcology/LandR
Date: 2020-06-16
Version: 0.0.6
Version: 0.0.7
Authors@R: c(
person("Eliot J B", "McIntire", email = "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6914-8316")),
Expand Down
8 changes: 4 additions & 4 deletions R/assertions.R
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ assertColumns <- function(obj, colClasses,
#' @template cohortData
#'
#' @template pixelGroupMap
#'
#' @template cohortDefinitionCols
#' @param sim If the \code{simList} is included, then the \code{browser()} call will be more useful.
#'
#' @param maxExpectedNumDiverge A numeric, length 1, indicating by how many they
Expand All @@ -197,7 +197,6 @@ assertColumns <- function(obj, colClasses,
#' was called.
#'
#' @param verbose Controls message output. Defaults to \code{getOption("LandR.verbose")}
#'
#' @note
#' TODO
#'
Expand All @@ -207,7 +206,8 @@ assertColumns <- function(obj, colClasses,
#' @rdname assertions
assertCohortData <- function(cohortData, pixelGroupMap, sim, maxExpectedNumDiverge = 1,
message = "", doAssertion = getOption("LandR.assertions", TRUE),
verbose = getOption("LandR.verbose", TRUE)) {
verbose = getOption("LandR.verbose", TRUE),
cohortDefinitionCols = c("pixelGroup", "age", "speciesCode")) {
if (doAssertion) {
if (!isTRUE("pixelGroup" %in% names(cohortData))) {
stop("cohortData must have pixelGroup")
Expand All @@ -219,7 +219,7 @@ assertCohortData <- function(cohortData, pixelGroupMap, sim, maxExpectedNumDiver
test2 <- sum(!b %in% a)

browser(expr = exists("aaaa"))
cohortDataN <- cohortData[, .N, by = c("pixelGroup", "speciesCode", "age", "B")]
cohortDataN <- cohortData[, .N, by = cohortDefinitionCols]
test3 <- which(cohortDataN$N != 1)
if (test1 > maxExpectedNumDiverge || test2 > maxExpectedNumDiverge) {
if (nchar(message) > 0) message(message)
Expand Down
171 changes: 81 additions & 90 deletions R/cohorts.R

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion R/makeDummyInputs.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ makeDummyEcoregionFiles <- function(ecoregionMap, rstLCC, rasterToMatch) {
ecoregionFiles <- Cache(ecoregionProducer,
ecoregionMaps = list(ecoregionMap, rstLCC),
ecoregionName = "ECODISTRIC",
ecoregionActiveStatus = ecoregionstatus,
rasterToMatch = rasterToMatch,
userTags = "ecoregionFiles")
return(ecoregionFiles)
Expand Down
2 changes: 2 additions & 0 deletions man-roxygen/cohortDefinitionCols.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#' @param cohortDefinitionCols the columns in \code{cohortData} that define unique cohorts
#'
3 changes: 3 additions & 0 deletions man/addNoPixel2CohortData.Rd

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

3 changes: 3 additions & 0 deletions man/addPixels2CohortData.Rd

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

5 changes: 4 additions & 1 deletion man/assertions.Rd

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

4 changes: 1 addition & 3 deletions man/columnsForPixelGroups.Rd

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

4 changes: 1 addition & 3 deletions man/dot-speciesTableColNames.Rd

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

4 changes: 1 addition & 3 deletions man/landisIIrepo.Rd

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

4 changes: 1 addition & 3 deletions man/pkgEnv.Rd

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

3 changes: 3 additions & 0 deletions man/rmMissingCohorts.Rd

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

6 changes: 2 additions & 4 deletions man/sppEquivalencies_CA.Rd

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

6 changes: 1 addition & 5 deletions man/uniqueDefinitions.Rd

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

7 changes: 4 additions & 3 deletions man/updateCohortData.Rd

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

7 changes: 5 additions & 2 deletions man/updateCohortDataPostHarvest.Rd

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

0 comments on commit a3944cf

Please sign in to comment.