- Package renamed to
HSestimate- In addition to checking Harvest Survey data,
HSestimatewill now also generate totals files and calculate harvest estimates.
- In addition to checking Harvest Survey data,
Imports- Add
{purrr} - Add
{utils}
- Add
- Introduced
@familytags to function documentation to help navigate networks of helper functions and species groups. New tags include:crane functionsdove functionsSCRG functionswaterfowl functionswoodcock functionschecking functionsdaily data helpers- used acrosscheck.R,party.R, andconvert.Rseason data helpers- used acrosscheck.Randconvert.Rerror assigning functions- used acrosscheck.Randparty.R
conversion functionsestimation functionsfailure functionsparty hunt functionswrangling functions
- Refactor checking functions in
R/check.R- Create more internal helper functions and move most of the internal helpers back in to
R/check.R; other files likeR/errorIDs.RandR/overbag.Rwere deleted (see e6656cf). - Create
surveyCheck()(previously namededitCheck()), the exported checking function which runs internal functions depending on species group. - Internal helpers:
audit()andauditDV()- Create the list of daily corrected, daily audit, season corrected, and season audit tibbles.
- Use recalculated and reassigned
retrievedvalues changed by checking party hunts and converting sea duck and brant harvest.
checkWF()is used for waterfowl instead of a combination ofsurveyCheck()andaudit(), since waterfowl must have SD and BR harvest converted to DK and GS, respectively, in a special step.- Check daily data
checkDailyWF()is used for waterfowl.checkDailyDV()is used for doves.checkDailySCRGWKCR()is used for snipe, coot, rails, gallinules, woodcock, and cranes.
- Check season data
checkSeasonDV()is used for doves.checkSeasonCR()is used for cranes.checkSeasonWFSCRGWK()is used for waterfowl, snipe, coot, rails, gallinules, and woodcock.
- Error checking
- Daily
partyHuntFinder()assignserror1(see R/party.R).dailyOverBagWWMO()assignserror2for doves.dailyOverBagDKSD()assignserror2for waterfowl.dailyOverBag()assignserror3for all species (including doves and waterfowl).
- Season
naDaysHunted()assignserror1.tooManyDaysHunted()assignserror2for all species groups. It calculates the exact number of days allowed hunting for each state and species combination, even when different types of seasons (e.g., youth, veteran, regular, etc) overlap.seasonOverBag()assignserror3for all species groups except doves.seasonOverBagDV()assignserror3for doves.
seasonDNH()assignserror4.
- Daily
- Checking season data
- Use
checkSeasonWFSCRGWK()on waterfowl, snipe, coot, rail, gallinule, and woodcock. - Use
checkSeasonCR()on cranes.
- Use
- Create more internal helper functions and move most of the internal helpers back in to
- Add estimation functions to
R/estimate.R, including:speciesEstimate()runs internal helpers in the following order:calcSumMeanVar()calculates thesum(),mean(), andvar()acrossdays_hunted,retrieved,unretrieved,activehunter, andsuccessfulhunter fields bystateandestimation_stratum.calcFreq()calculates the number of hunters byestimation_stratum.calcAllStats()joins the sum, mean, variance, number of hunters by stratum, and species counts together.calcVar()calculates multiple values using the product ofcalcAllStats(), such as: finite population correction factor, variance, total days hunted by stratum, total retrieved harvest by stratum, and total unretrieved harvest by stratum.stateTotals()sums values calculated incalcVar()by state.
assignFlyway()assignFlywaySDBR()assignMgmtUnit()hunterEstimates()harvestEstimates()stateSelect()mgmtUnitSelect()flywayTotals()mgmtUnitTotals()flywayFinal()flywayFinalSDBR()mgmtUnitFinal()usFinal()usFinalDV()
- Modify internal failure functions in
R/fails.R- Delete
fails() - Create:
failtype()fails iftypeis not one of: 'Ducks', 'Geese', 'Brant', 'SeaDucks', 'MODO', 'WWDO', 'SACR', 'Woodcock', 'Snipe', 'Coots', 'Rails', 'Gallinules', 'BTPI'.failStateCount()returns a message if the number of states in the season or daily data does not match the expected count.failNARetrieved()fails ifNAvalues are found in theretrievedfield.failNADaysHunted()fails ifNAvalues are found in thedays_huntedfield.failSurveyStates()fails if the list of states in the data being used to generate estimates is different from the standard list of expected states for that species group.
- Delete
- Update
test-check.R - Added package startup message (see
zzz.R)
- Fixed bugs in
convertWWDO()dplyr::case_when()not compatible with usingtypein conditional statements, so movederrors_dfcreation.
- Renamed
variables.Rtoconstants.R- Eliminate all
REF_DAY_LIMIT_internal reference objects. - Reordered and alphabetized vectors.
- Added internal reference objects:
REF_STATES_ALLREF_STATES_DKREF_STATES_GSREF_STATES_MODOREF_STATES_WKREF_STATES_COOTSREF_STATES_RAILSREF_STATES_GALLSREF_STATES_BTPI
- Eliminate all
- Added new
variables.Rfor package versions and season assignment. - Rename
state_numberstoREF_STATE_NUMBERS.
- Last version for
migbirdHS
- Renamed to
migbirdHS - Added a
NEWS.mdfile to track changes to the package. - Edited
proofHS()function to show additional informative decision-making columns in output.
- New updates for 2022-2023 HS data checks.
- Overhaul of
add_seaducks() - Removed
correctHS() - Deprecated
read_dhs() - Added internal function
wrangle_ref()and used it to replace redundant code across multiple exported functions. - The
%>%pipe was replaced with|>when possible. - Vignette updated.