From a1828750df64401769cf73db40143729f0b0ef0a Mon Sep 17 00:00:00 2001 From: Tracey Date: Mon, 23 Oct 2023 17:34:09 -0600 Subject: [PATCH] fix bug in popevalid --- R/modGBpop.R | 4 ++-- R/modMApop.R | 4 ++-- R/modSApop.R | 4 ++-- R/modWFpop.R | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/R/modGBpop.R b/R/modGBpop.R index f2d1922b..d81eeb19 100644 --- a/R/modGBpop.R +++ b/R/modGBpop.R @@ -508,8 +508,8 @@ modGBpop <- function(popType = "VOL", "CHNG", "GRM", "GROW", "MORT", "REMV") popType <- pcheck.varchar(var2check=popType, varnm="popType", gui=gui, checklst=evalTyplst, caption="popType", multiple=FALSE, stopifnull=TRUE) - if (!is.null(popFilter2$evalid)) { - popevalid <- as.character(popFilter2$evalid) + popevalid <- as.character(popFilter2$evalid) + if (!is.null(popevalid)) { substr(popevalid, nchar(popevalid)-1, nchar(popevalid)) <- formatC(FIESTAutils::ref_popType[FIESTAutils::ref_popType$popType %in% popType, "EVAL_TYP_CD"], width=2, flag="0") diff --git a/R/modMApop.R b/R/modMApop.R index 0b8add27..77d1cedb 100644 --- a/R/modMApop.R +++ b/R/modMApop.R @@ -465,8 +465,8 @@ modMApop <- function(popType="VOL", evalTyplst <- c("ALL", "CURR", "VOL", "LULC", "P2VEG", "INV", "DWM", "CHNG", "GRM") popType <- pcheck.varchar(var2check=popType, varnm="popType", gui=gui, checklst=evalTyplst, caption="popType", multiple=FALSE, stopifnull=TRUE) - if (!is.null(popFilter2$evalid)) { - popevalid <- as.character(popFilter2$evalid) + popevalid <- as.character(popFilter2$evalid) + if (!is.null(popevalid)) { substr(popevalid, nchar(popevalid)-1, nchar(popevalid)) <- formatC(FIESTAutils::ref_popType[FIESTAutils::ref_popType$popType %in% popType, "EVAL_TYP_CD"], width=2, flag="0") diff --git a/R/modSApop.R b/R/modSApop.R index 95d8c0b7..c029d741 100644 --- a/R/modSApop.R +++ b/R/modSApop.R @@ -373,8 +373,8 @@ modSApop <- function(popType="VOL", evalTyplst <- c("ALL", "CURR", "VOL", "LULC", "P2VEG", "INV", "DWM", "CHNG", "GRM") popType <- pcheck.varchar(var2check=popType, varnm="popType", gui=gui, checklst=evalTyplst, caption="popType", multiple=FALSE, stopifnull=TRUE) - if (!is.null(popFilter2$evalid)) { - popevalid <- as.character(popFilter2$evalid) + popevalid <- as.character(popFilter2$evalid) + if (!is.null(popevalid)) { substr(popevalid, nchar(popevalid)-1, nchar(popevalid)) <- formatC(FIESTAutils::ref_popType[FIESTAutils::ref_popType$popType %in% popType, "EVAL_TYP_CD"], width=2, flag="0") diff --git a/R/modWFpop.R b/R/modWFpop.R index d80d9412..7a28b79b 100644 --- a/R/modWFpop.R +++ b/R/modWFpop.R @@ -471,8 +471,8 @@ modWFpop <- function(popType = "VOL", evalTyplst <- c("ALL", "CURR", "VOL", "LULC", "P2VEG", "INV", "DWM", "CHNG", "GRM") popType <- pcheck.varchar(var2check=popType, varnm="popType", gui=gui, checklst=evalTyplst, caption="popType", multiple=FALSE, stopifnull=TRUE) - if (!is.null(popFilter2$evalid)) { - popevalid <- as.character(popFilter2$evalid) + popevalid <- as.character(popFilter2$evalid) + if (!is.null(popevalid)) { substr(popevalid, nchar(popevalid)-1, nchar(popevalid)) <- formatC(FIESTAutils::ref_popType[FIESTAutils::ref_popType$popType %in% popType, "EVAL_TYP_CD"], width=2, flag="0")