Skip to contents

migbirdHIP 2026.0.2

Minor changes / bug fixes

  • Fix bug in REF_DATES.

migbirdHIP 2026.0.1

Minor changes / bug fixes

  • Exclude North Dakota from being evaluated by qIssueDateRange().
  • Updated REF_BAGS for AR cranes, band_tailed_pigeon, brant, and seaducks to expect state bag value of 0.
  • Updated REF_DATES for SD issue window start date to be 5/6/2026.
  • Edited regYearEditMessage() message text to contain sum of affected registrations.

migbirdHIP 2026.0.0

Versioning scheme change

Starting with the 2026-2027 season, version numbers will follow a calendar versioning scheme (YEAR.STAGE.PATCH) instead of semantic versioning (MAJOR.MINOR.PATCH). The new convention will be more informative to users looking to downgrade migbirdHIP, since release tags will be based on the applicable migratory game bird hunting season rather than arbitrary numbers. Previous releases will retain their original version numbers, which are still defined in variables.R.

Version component definitions:

  • YEAR - the year of the migratory game bird hunting season (e.g. 2026 for the 2026-2027 season).
  • STAGE - the maturity of the season’s release, either 0 or 1:
    • 0 = the season is ongoing; used for releases between July and the following April, approximately (e.g. 2026.0.12).
    • 1 = the definitive package version for the entire season, indicating a stable build that should be used if downgrading (e.g., 2026.1.0 for an April 2027 definitive version).
  • PATCH - incremental fixes within the current stage:
    • For an ongoing season, a bug fix would be released as 2026.0.3 and subsequent new feature would be released as 2026.0.4.
    • For critical fixes after a definitive season release, to be avoided unless necessary (e.g., 2026.1.1).

Use of artificial intelligence

AI tools approved and offered by the U.S. Department of the Interior were used to aid in the development of v2026.0.0. All AI-generated and AI-assisted code, tests, and review were checked, approved, and often re-worded or changed by the migbirdHIP package author before inclusion. The only fully AI-generated code included in the package is new unit tests, which are clearly labeled in code comments. Anthropic’s Claude Opus 4.8 and Opus 5 (both via Perplexity) were the primary models used to generate and review code, with the occasional use of other available models in Perplexity (chosen by Perplexity Computer’s default orchestration), in July 2026.

AI was used for tasks such as:

  • Identifying gaps in unit test coverage and subsequently writing new unit tests, which are labeled in code comments.
  • Assisting in function refactoring (but not independently rewriting functions).
  • Agentic code review to help find typos and errors.

Major changes & new features

Minor changes / bug fixes

  • Dependency updates
    • Following dplyr 1.2.0 release notes, update case_when() with recode_values() and replace_when() as appropriate.
  • Internal package data
    • Updated internal package test data to create character title values rather than numeric.
  • Functions
    • Fail gracefully if input provided contains 0 rows (or data are dropped to result in 0 rows) for clean(), proof(), and write_hip().
    • Changed issuePlot() legend to say “Registration year provided” to be clear that the value has not been changed/edited yet.
    • proof() no longer filters out test records, since this step is completed upstream in clean().
    • write_hip(split = FALSE) had a bug in the file naming technique that is now resolved.
    • issueDecide() renders mdy(issue_date) only once, and then deselects the column, rather than calling it seven times in the case_when()
    • fileCheck() now runs list.files() only once per path
    • Reduced repetition in errorPlotDL()
    • Reduced geom_vline() repetition in issuePlot()
  • Testing
    • Added test files
      • Added: test-quality.R, test-write_hip.R, test-writeReport.R, test-errorPlots.R, test-errorTables.R, and test-files.R
      • Added test-edge-inputs.R to test empty (0-row), all-NA-in-key-columns, and single-row inputs.
    • Expanded unit testing
      • correctEmail() testing and that correct() changes values to NA as expected in test-correct.R
      • duplicateFinder() and duplicatePlot() testing in test-duplicates.R
      • Testing passing messages in test-glyphs.R and test-shifts.R
      • Added tests for registration_yr field, birth_date field, and zip field in test-proof.R
      • Added tests for unique = FALSE and season = TRUE in test-read_hip.R
      • Updated test-proof.R to use getBad family of functions
      • Updated test-fails.R to evaluate failWidths()
      • Added bagCheck() tests to test-bags.R
      • Added zipCheck() tests to text-clean.R
  • DESCRIPTION
    • Require R version >= 4.5.0
    • Imports
      • Update lubridate to >=1.9.5
      • Update purrr to >= 1.2.1
      • Update data.table to >= 1.18.2
      • Update stringr to >= 1.6.0
      • Update readr to >= 2.2.0
      • Update dplyr to >= 1.2.0
      • Update rlang to >= 1.1.7
      • Update ggplot2 to >= 4.0.2
    • Suggests
      • Update rmarkdown to >= 2.30
      • Update sf to >= 1.1-0
  • Recommend installation in README and vignette changed to pak::pak() now that devtools::install_github() has been deprecated.
  • Updated package startup message in zzz.R
    • Version checking is now more robust; messages are more reliable and clear if a package version is out of date.

migbirdHIP 1.4.13

Final definitive version for the 2025-2026 season.

Minor changes / bug fixes

migbirdHIP 1.4.12

Minor changes / bug fixes

  • Fixed fileRename() bug that returned a message if dir contained subfolder.
  • Updated REF_BAGS for FL geese_bag to only include 0
  • Download report template
    • Removed double spaces.
    • Moved missing email figure legend to the bottom; gives more space for x-axis state abbreviations.
    • Comma formatting for long numbers
      • Bag check table for Count field
      • Non-current records table for Count outside window field
      • Future records table for Number of records
      • Bar labels for plot of errors by field for both before and after correction
      • Causes of errors for top 3 fields table for count field
      • Causes of errors by state for count field
  • errorPlotStates() and errorPlotFields()
    • Use format.default() for bar labels to add commas to big numbers, which fixes the Errors by Field Before Correction plot and the Errors by State before and after correction plots in the download report.

migbirdHIP 1.4.11

Minor changes / bug fixes

  • Updated REF_BAGS for ID dove_bag and MA woodcock_bag, changing 5 to 4
  • Bug fix for duplicatePlot() to show correct bar labels and y position

migbirdHIP 1.4.10

Minor changes / bug fixes

  • Replaced ID start date with 12/1/2024.
  • Fixed time to read in files message returned by read_hip().

migbirdHIP 1.4.9

Minor changes / bug fixes

  • issueDecide() was returning "overlap" as a result in the decision field, and the "overlap" records were being dropped. This should not happen; "overlap" records should be assigned "future" or "current" and only "past" records are to be dropped.

migbirdHIP 1.4.8

Major changes & new features

  • Evaluate Mississippi issue dates
    • Add MS to REF_DATES
    • No longer assign "MS" as decision in issueCheck()
    • No longer exclude "MS" from nDropped() or dl_report.qmd
  • Added 3 new internal functions:

Minor changes / bug fixes

  • write_hip()
    • Minor changes to match modern tidyverse syntax
    • Add check to ensure REF_PMT_FILES states are not in zero_translations
  • REF_BAGS changes:
    • Bug fixes
      • Add lines for missing, existing, and expected bag values
        • UT band_tailed_pigeon bag 2 -> stratum 2
        • MN cranes bag 2 -> stratum 2
    • Update
      • Add line for FL geese_bag bag 0 -> stratum 0

migbirdHIP 1.4.7

Minor changes / bug fixes

  • Add stateBagValue of 3 and 5 to REF_BAGS for IA woodcock_bag

migbirdHIP 1.4.6

Minor changes / bug fixes

  • Updated REF_DATES$issue_start for FL to be 2025-04-01

migbirdHIP 1.4.5

Minor changes / bug fixes

  • Edited nDroppedClean() function to capture records if they contain an NA value in any one bag field, in addition to existing rule that captures records if all bag fields are NA.

migbirdHIP 1.4.4

Minor changes / bug fixes

  • Updated REF_BAGS stateBagValue to 5 for CO dove_bag (previously 4)

migbirdHIP 1.4.3

Minor changes / bug fixes

  • Edited proofBadEmails() to allow all variations of ccTLDs to be accepted for yahoo, hotmail, outlook, and live email domains.
    • The previously strict filter only accepted .com, .co.uk, .fr, .es, .ca, and .de for yahoo and hotmail email addresses. In addition, only .com was accepted for live and outlook email addresses.
    • Now, live European ccTLDs and yahoo emails with Indian and Australian ccTLDs, to name a few examples, will pass without being flagged as errors.

migbirdHIP 1.4.2

Minor changes / bug fixes

  • NA emails are not errors!
    • Updated proofBadEmails() to allow NA values in email field.
    • Updated proofBadEmails() function description so that the criteria for good emails is clear on the help page.
    • Updated test-proof.R unit testing.
    • Edited create_fake_HIP_data.R and overwrote internal test data stored in /inst/extdata/DL0901/, /tests/testthat/data/DL0902/, and DF_TEST objects by introducing NA values to email field.
  • Edited zzz.R to return a startup error message in case the package version in the DESCRIPTION was modified before appending REF_RELEASES in variables.R.

migbirdHIP 1.4.1

Major changes & new features

Minor changes / bug fixes

migbirdHIP 1.4.0

Major changes & new features

  • Changed contents of R/sysdata.rda
    • Fewer objects are now stored in sysdata.rda (reduced from 14 to 7). This enhances transparency and reduces the number of objects that must be generated outside of the R package itself.
    • sysdata.rda now contains: REF_ZIP_CODE, REF_BAGS, REF_DATES, REF_STATES_2SEASON, REF_STATES_1SEASON, REF_EMAIL_TLDS, and SF_HEXMAP
    • Seven objects were moved to constants.R:
      • ref_bagfields, abbr_usa, abbr_canada, pmt_inline, pmt_files, states_sdbr, and states_seaducks were moved and renamed REF_FIELDS_BAG, REF_ABBR_USA, REF_ABBR_CANADA, REF_PMT_INLINE, REF_PMT_FILES, REF_STATES_SD_BR, and REF_STATES_SD_ONLY, respectively.
    • Two objects were dropped entirely. MS_firstday and MS_lastday are no longer needed by issueCheck().
    • Five internal data objects were renamed:
      • REF_BAGS (previously hip_bags_ref), REF_DATES (previously licenses_ref), REF_ZIP_CODE (previously zip_code_ref), REF_STATES_2SEASON (previously states_twoseason) and SF_HEXMAP (previously hexmap).
    • Two new objects were added: REF_STATES_1SEASON and REF_EMAIL_TLDS
    • REF_DATES was changed to no longer include last_day_migbird_hunting and category fields.
  • Added test data
    • Fake HIP test data creation script stored under data-raw/
    • Test data containing fake HIP registrations stored as fixed-width .txt files under inst/extdata/DL0901/, to be used in testing or simulating read_hip()
    • Miniature and tiny test data stored as exported .rda files under data/, to make it easier to demonstrate functions and run unit tests
      • DF_TEST_MINI contains 1,606 rows from 7 states (OR records to represent solo permit state, ME records to represent SD-only state, DE records to represent SD and BR state, ND records to represent CR state, UT records to represent BT state, CO records to represent CR and BT state, and IA records to represent non-BT, CR, SD, or BR state) and is formatted as though the data were just read in.
      • Six tiny test data objects:
        • DF_TEST_TINI_READ is a subset of DF_TEST_MINI, and contains 3 rows formatted as though the data were just read in
        • DF_TEST_TINI_CLEANED is the result of running clean() on DF_TEST_TINI_READ
        • DF_TEST_TINI_CURRENT is the result of running issueCheck() on DF_TEST_TINI_CLEANED
        • DF_TEST_TINI_DEDUPED is the result of running duplicateFix() on DF_TEST_TINI_CURRENT
        • DF_TEST_TINI_PROOFED is the result of running proof() on DF_TEST_TINI_DEDUPED
        • DF_TEST_TINI_CORRECTED is the result of running correct() on DF_TEST_TINI_PROOFED
  • Created variables.R to define seasonally changing variables in a central place.
    • REF_CURRENT_SEASON for current HIP season.
    • REF_RELEASES is a named vector of all migbirdHIP package releases and the corresponding season of HIP data that the version was intended for.
  • Created constants.R to define variables in a central place and thus evaluate data consistently.
    • Variables are used across functions (e.g., inLinePermitDNHMessage() and inLinePermitDNHFix() both use LOGIC_INLINE_PMT_DNH) and are shared between functions and testthat files.
    • New naming convention helps users to use and find internal reference data objects more quickly by using uppercase letters and categorical prefixes (REF_, LOGIC_, REGEX_, and SF_).
  • New functions
  • Refactored and edited functions
  • Renamed and moved functions
    • Renamed strataCheck() to bagCheck() and renamed strata.R to bags.R.
      • bagCheck() split and now uses an internal function, summarizeBadBags().
      • Standardized using the phrase “bag values” over the term “strata”; HIP records contain bag values until they are written out and strata are assigned.
    • Renamed renameFiles() to fileRename() and moved from renameFiles.R to files.R to be grouped with fileCheck() (previously in fileCheck.R).
    • findDuplicates() and fixDuplicates() renamed to duplicateFinder() and duplicateFix() to mirror naming conventions of other functions with the subject of the verb coming first (e.g. glyphFinder(), glyphCheck()).
    • All functions related to duplicates moved to duplicates.R (previously separated into findDuplicates.R and fixDuplicates.R)
    • Renamed functions using camel case except for read_hip() and write_hip()
    • redFlags() no longer exported (used only in the download report), moved to the errorPlots.R script instead of being in its own file
  • Deleted functions
    • Deleted validate(), investigate(), and identicalBags().
    • Deleted demographic-oriented outOfStateHunters() and youthHunters() functions because they were not being used.
    • Deleted recordLevel_errors_state() function since it was not being used.
    • sumLines() deleted and read_hip() param sumlines eliminated; no longer used and not considered useful moving forward.

Minor changes / bug fixes

  • Vignette
    • Since the package now contains comprehensive test data, there is no need to pre-compute the vignette using HIP data stored locally.
    • The vignettes/man/migbirdHIP_workflow.Rmd.orig file was deleted.
    • Unused files in the vignettes/image/ subdirectory were deleted; used files were moved to man/figures/.
  • Template dl_report.qmd:
    • Sorted errors by descending in “causes of errors by state” table.
    • Eliminated breaking error in report rendering if there is no field exceeding the error threshold.
    • Removed all-zero bag section from the Agenda tab.
    • Added comma formatting to long numbers.
    • On the Errors tab, moved the “Bad zip codes” section to its own sub-header after “Causes of errors for top 3 fields”.
  • Add zzz.R
    • Run package startup message which returns the installed migbirdHIP package version and which season of HIP data the package version is compatible with.
  • Deleted globals.R and switched to data masking with rlang pronoun .data.
  • Incorporated some linting with lintr and added .lintr to .gitignore and .Rbuildignore.
  • Almost all data params changed to be less ambiguous (e.g. x now cleaned_data, proofed_data, etc).
  • tibble no longer a required import
  • read_hip() now catches file names with incorrect MMDDYYYY or DDMMYYYY date format.
  • issueCheck() now returns an error for NA values in record_key field.
  • Added release tags to README.
  • Replace deprecated ~ .x anonymous function notation with \(x).

migbirdHIP 1.3.0

Major changes & new features

  • Edited shiftCheck() to return a summary of shift errors rather than just a table of record id values.
  • Edited issueCheck(), issueAssign(), and issuePlot() to accommodate new rules in evaluating if a record is current. All records are now current unless their issue_date falls before issue_start or after the last day of migratory bird hunting in the record’s state.
  • Edited proof() and errorPlot_fields() to no longer flag and/or plot youth hunters (hunters with birth year < 16 years ago).

Minor changes / bug fixes

  • Template dl_report.qmd
    • Excluded future data line from agenda tab
    • Minor adjustments for edge cases in which summary variables are NULL
    • Added clarification to table captions
    • Eliminated irrelevant error and warning message printouts from rendered report
    • Remove inconsequential “bad bags” from Agenda tab; do not report 1s received instead of 0s, or 0s received instead of 1s
    • Edited “bad bags” section of agenda tab to return a message in the edge case of 0% of a file containing bad bag values
    • Edited the Issuance tab to reflect new rules in evaluating if a record is current
  • Edited identicalBags() function to exclude matching coots_snipe and rails_gallinules from MI in output; this state uses the response from one question to populate both fields.
  • Edited read_hip() function to exclude “hold” subdirectories when reading season HIP data.
  • Updated R dependency to v4.4.0.
  • Added programmatic stops to all functions to safeguard against running with incorrect/invalid parameters.
  • Reduced variation in parameter names:

migbirdHIP 1.2.8

Major changes & new features

  • Added a NEWS.md file to track changes to the package.
  • Added package documentation page man/migbirdHIP-package.Rd
  • New fileCheck() function: checks if any files in the input folder have already been written to processed folder.
  • New shiftCheck() function: find and print any rows that have a line shift error with number of positions shifted.
  • New identicalBags() function: returns output if any columns are exactly the same in a file; does not return “no season” matches.
  • New glyphCheck() function: pull and view any non-UTF-8 characters in the raw data; helps guide manual fixes to read in the HIP files without line shifts.
  • Added 3 new internal package functions (errorLevel_errors_field(), errorLevel_errors_state(), and recordLevel_errors_state()), which are used inside redFlags(), errorPlot_fields(), and errorPlot_states(). They reduce code redundancy and ensure updates happen universally.
  • Added 2 new internal package functions (issueAssign() and issuePlot), which are used inside of issueCheck() and by the download report (dl_report.qmd).
  • Added internal function strataFix() to be used inside of clean() to resolve false permit labels. This function edits strata values for band_tailed_pigeon and crane from states that submit permit files for crane and band-tailed pigeons; values changed from "2" to "0".
  • Edited writeReport() to render quarto documents.
  • Edited issueCheck() to place more emphasis on issue_date to determine relevancy of a record. The function no longer exports future and past data as .csv files. Past data are still filtered out from the returned tibble. Output messages indicate if future data exist.
  • Edited clean() function:
    • Filter out any rows that contain a bag value other than a single digit
    • Eliminated address cleaning
    • Moved zip code checking and messaging to clean() from proof(); now checks on entire zip code, not just prefix. Remove ending 0 when zip value is 10 digits long.
    • Changed Oregon solo permit hunt_mig_birds field when it equals "0" to "2". For context, a solo permit contains a "2" in at least one of the band_tailed_pigeon, brant, or seaduck fields and contains "0" in all other bag fields.
  • Edited correct() to remove any records with value of "0" or NA value in every bag field; improved email field cleaning and repair.
  • Edited strataCheck() to return two additional fields in output; 1) number of bad strata and 2) proportion of bad strata. The function now checks for permit species coming during regular HIP and returns them as erroneous (e.g. NM band_tailed_pigeon = "2").
  • Edited write_hip() to set any state/species combinations without a season to have strata of "0"; bad bag values remain NA.
  • Edited sumLines() to improve speed and efficiency. In addition, the function now returns a data table with the sum of lines per file instead of a single number. No longer exported; set as internal function.
  • Edited read_hip() to eliminate encoding check and optionally use sumLines() function to ensure all lines were read in. Returns a message if any records contain a bag value other than a single digit. In addition, now converts blank strings to NA.
  • Edited validate() to return source_file field and filter out states and species with no season from function output.
  • Edited investigate() to no longer be exported; it works inside of validate() to return a more detailed output. This replaces the previous workflow of running investigate() separately.
  • Removed manualFix() function because it is no longer relevant to the package.
  • Removed shiftFix() because line shift errors cannot be fixed programmatically on a reliable basis.
  • Templates
    • New Quarto dl_report.qmd replaced RMarkdown dl_report.Rmd.
      • The new Quarto layout allows tabset panels which divides content into sections that can be more easily read and focused on by the user. Tabset panels were also incorporated for before and after plots to show proportion of errors that are corrected during pre-processing.
      • A new summary section distills the findings of the functions overall for the user to discern the most important issues from the HIP files that were processed. This is partly accomplished with the use of a catch_messages() function created only for use in the dl_report.qmd and is not exported or contained within the migbirdHIP package internally. The catch_messages() function wraps around pre-processing functions (such as read_hip(), clean(), issueCheck(), etc) and captures messages in a list so that they can be returned as readable bullet points.
      • A new map displays time lag of files received from 49 states in a hexagonal representation of the continental US.
      • Emojis are printed with output text to quickly indicate to readers whether issues ❌ need attention or ✔️ are not concerning.
      • Sections added as needed to report on new function output (see above for which new functions were added).
      • A new section lists any states that were excluded from the output when they submitted data for that download (e.g. all records were issued in the past and are not eligible for the current season; perhaps sent by mistake).
    • Eliminated season_report.Rmd template
  • Imports
    • Removed magrittr and rmarkdown
    • Added quarto and sf
  • Suggests
    • Added spelling
  • Internal package data (sysdata.rda)
    • Added vectors of abbreviated US territories and Canada provinces/territories, both updated to include missing abbreviations from previous versions and remove redundant abbreviations
    • Added vector of bag field names
    • Added vector of two-season states
    • Added vectors of seaduck and brant states, seaduck-only states, and two-season states
    • Added hexmap grid for download report
    • Added tibbles of permit file states/species and states/species of permits received inline
    • Updated zip code reference table, bag reference table, license window reference table, and MS reference dates

Minor changes / bug fixes

  • License changed to CC0 (previously Public Domain), which was causing a warning in devtools::check()
  • Refactored write_hip() to eliminate redundancy; replaced repeated left_join() with for loop
  • Refactored findDuplicates() by throwing an error message for a bad string supplied to the return parameter at the start, which reduces wait time for failure.
    • Investigated replacing findDuplicates() redundancy of searching for duplicate fields using a for loop or purrr::map(), but this change added 20+ seconds of processing time so left the redundancy as-is.
  • Refactored all functions that take a path parameter to add a forward slash to the end each supplied path if not included by the user.
  • Replaced superseded tidyr::separate() with tidyr::separate_wider_delim() or tidyr::separate_wider_position()
  • Replaced dplyr::summarize() with dplyr::reframe() since returning more than 1 row per group was deprecated in dplyr 1.1.0
  • Replaced ggplot::stat() with ggplot::after_stat(), since the former was deprecated in ggplot2 3.4.0
  • Replaced tidy pipes %>% and %<>% with base R pipe |> for increased speed and reduced dependency on tidyverse packages.
  • Edited DESCRIPTION file:
    • Changed package description
    • Set language to en-US
    • Added a URL to the Harvest Information Program website
  • Incorporated usethis::use_spell_check() to package checking workflow, which added an inst/WORDLIST file (whitelisted words) to the package.

migbirdHIP 1.2.7

  • Updated strata reference table in sysdata.rda
  • Added kable summary tables to horizontal repetition checks in the download report template
  • Due to new kables, updated DESCRIPTION to include kableExtra as a Suggests (and added other packages used in the dl_template.Rmd not previously included)
  • Updated .Rbuildignore to reduce R CMD check notes

migbirdHIP 1.2.6

migbirdHIP 1.2.5

  • Operational for 2022-2023 season

migbirdHIP 1.2.4

  • Final version compatible with 2021-2022 season data

migbirdHIP 1.2.3

  • Updated fixDuplicates() and validate()

migbirdHIP 1.2.2

  • Updated vignette
  • Updated readme
  • Updated description

migbirdHIP 1.2.1

  • Updated package name to migbirdHIP in function documentation

migbirdHIP 1.2.0

  • Package renamed migbirdHIP