ices-taf / doc

Community documentation for the TAF project
http://taf.ices.dk
11 stars 4 forks source link

Fix issues with icesDatras::getCatchWgt. #286

Closed cekv closed 2 years ago

cekv commented 2 years ago

There is an issue with countries sharing ships in NS-IBTS and BITS (SE and DK) which means that the key is identical for some rows. I think this can be circumvented by adding country to that key?!

Jobs required:

colinpmillar commented 2 years ago

Lines to change: https://github.com/ices-tools-prod/icesDatras/blob/d4e9d7e18d97f8792ffcf6eb6331c4541fa4efbe/R/getCatchWgt.R#L39-L41

colinpmillar commented 2 years ago

proposed change:

  hh$HaulID <- with(hh, paste(Year, Quarter, Ship, Country, StNo, HaulNo, sep="."))
  hl$HaulID <- with(hl, paste(Year, Quarter, Ship, Country, StNo, HaulNo, sep="."))
  key <- c("Year", "Quarter", "Ship", "StNo", "HaulNo", "HaulID")
cekv commented 2 years ago

This line needed "Country" added as well: key <- c("Year", "Quarter", "Ship", "Country", "StNo", "HaulNo", "HaulID")

cekv commented 2 years ago

DATRAS package published to CRAN with the fix