In Atlantis MHI (Main Hawaiian Islands), we have an MS group code and an MSL group code.
When running:
ssb_rec <- load_rec(yoy = yoy, ssb = ssb, prm_biol = prm_biol)
I received this error:
Error in FUN(X[[i]], ...) : Variable KWRR_MS found multiple times.
Which I traced back to the scan_prm function which is called in the extract_prm function, which is called in the load_rec function.
In scan_prm, the first line:
pos <- grep(pattern = variable, x = chars)
matches the string 'MS' to both MS and MSL.
The workaround I applied was:
pos <- grep(pattern = paste0(variable,' '), x = chars)
which will search for 'MS ' with a space attached to the end, and thus not match MSL.
In Atlantis MHI (Main Hawaiian Islands), we have an MS group code and an MSL group code.
When running:
ssb_rec <- load_rec(yoy = yoy, ssb = ssb, prm_biol = prm_biol)
I received this error:
Error in FUN(X[[i]], ...) : Variable KWRR_MS found multiple times.
Which I traced back to the scan_prm function which is called in the extract_prm function, which is called in the load_rec function.
In scan_prm, the first line:
pos <- grep(pattern = variable, x = chars)
matches the string 'MS' to both MS and MSL.
The workaround I applied was:
pos <- grep(pattern = paste0(variable,' '), x = chars)
which will search for 'MS ' with a space attached to the end, and thus not match MSL.