Skip to content

Commit

Permalink
clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrescino committed Apr 24, 2024
1 parent e0221c9 commit 0b969a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 7 additions & 5 deletions R/check.popdataCHNG.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,31 @@ check.popdataCHNG <- function(tabs, tabIDs, popType = popType,
##########################################################

## Check name of COND table
pltnmchk <- checktabs(tabs, c("plt", "plot"))
pltnmchk <- checktabs(tabs, c("pltu", "plot"))
if (is.null(pltnmchk)) {
message("plot data needed for estimates")
return(NULL)
}
if (is.character(tabs[[pltnmchk]])) {
pltnm <- tabs[[pltnmchk]]
} else {
pltnm <- "plt"
pltnm <- pltnmchk
pltflds <- names(plt)
}
assign(pltnm, tabs[[pltnmchk]])
puniqueid <- tabIDs[[pltnmchk]]

## Check name of COND table
condnmchk <- checktabs(tabs, "cond")
condnmchk <- checktabs(tabs, "condu")
if (is.null(condnmchk)) {
message("cond data needed for estimates")
return(NULL)
}
if (is.character(tabs[[condnmchk]])) {
condnm <- tabs[[condnmchk]]
} else {
condnm <- "cond"
condnm <- condnmchk
condflds <- names(cond)
}
assign(condnm, tabs[[condnmchk]])
cuniqueid <- tabIDs[[condnmchk]]
Expand All @@ -108,7 +110,7 @@ check.popdataCHNG <- function(tabs, tabIDs, popType = popType,
if (is.character(tabs[[sccmchk]])) {
sccmnm <- tabs[[sccmchk]]
} else {
sccmnm <- "sccm"
sccmnm <- sccmchk
}
assign(sccmnm, tabs[[sccmchk]])
sccmid <- tabIDs[[sccmchk]]
Expand Down
4 changes: 3 additions & 1 deletion man/popFilters.Rd

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

0 comments on commit 0b969a9

Please sign in to comment.