Skip to content

Commit

Permalink
bug: fix the last bug fix
Browse files Browse the repository at this point in the history
Actually fix the input checks :)
  • Loading branch information
nathanvaughan-NOAA committed Jun 10, 2024
1 parent 479b27c commit 5c846f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/manipulate_EM.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ get_EM_dat <- function(OM_dat, EM_dat, do_checks = TRUE) {
}
dat <- list(OM_dat = OM_dat, EM_dat = EM_dat)

if (OM_dat[["discard_data"]] == 1) {
if (!is.null(OM_dat[["catch"]])) {
Catches <- lapply(dat, function(x) {
tmp <- combine_cols(x, "catch", c("year", "seas", "fleet"))
})
Expand All @@ -77,7 +77,7 @@ get_EM_dat <- function(OM_dat, EM_dat, do_checks = TRUE) {
new_dat[["catch"]] <- Catches[[1]][matches, -ncol(Catches[[1]])]
}

if (OM_dat[["discard_data"]] == 1) {
if (!is.null(OM_dat[["discard_data"]])) {
Discards <- lapply(dat, function(x) {
tmp <- combine_cols(x, "discard_data", c("Yr", "Seas", "Flt"))
})
Expand All @@ -87,7 +87,7 @@ get_EM_dat <- function(OM_dat, EM_dat, do_checks = TRUE) {
new_dat[["discard_data"]] <- Discards[[1]][matches, -ncol(Discards[[1]])]
}

if (OM_dat[["CPUE"]] == 1) {
if (!is.null(OM_dat[["CPUE"]])) {
CPUEs <- lapply(dat, function(x) {
tmp <- combine_cols(x, "CPUE", c("year", "seas", "index"))
})
Expand Down

0 comments on commit 5c846f3

Please sign in to comment.