-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Discussed in #77
Originally posted by andybeet September 30, 2024
The aggregate_area function gets passed a userAreas data frame which is used to proportion species landings and values attributed to statistical areas that straddle EPU definitions. This proportioning was based on the mskeyrun project.
The bundled comlandr::mskeyAreas data frame is the list of statistical AREAS and which EPUs they map to. This also contains the NESPP3 code and the proportion of the landings that should be attributed to each EPU. This object ONLY contains statistical AREAS that straddle EPUs. Therefore when this is joined to the data all other Statistical Areas get assigned the EPU: "Other"
We should not use this object until we have fixed this.
Alternatively another data object (epuAreas) used to define EPUs by statistical AREAs is:
gom <- data.table(AREA = c(500, 510, 512:515), EPU = 'GOM')
gb <- data.table(AREA = c(521:526, 551, 552, 561, 562), EPU = 'GB')
mab <- data.table(AREA = c(537, 539, 600, 612:616, 621, 622, 625, 626, 631, 632),
EPU = 'MAB')
ss <- data.table(AREA = c(463:467, 511), EPU = 'SS')
epuAreas <- rbindlist(list(gom, gb, mab, ss))
epuAreas[, NESPP3 := 1]
epuAreas[, MeanProp := 1]
This also seems to have a flaw (when applyPropLand = T) in that the join by AREA and NESPP3 only assigns EPU to species with NESPP3 code = 1. The total landings will be correct for all of the species but they'll be assigned to EPU: "Other"
Looking into this