usfws / migbirdhip Goto Github PK
View Code? Open in Web Editor NEWAn R package designed to process, clean, and visualize Harvest Information Program (HIP) data
License: Creative Commons Zero v1.0 Universal
An R package designed to process, clean, and visualize Harvest Information Program (HIP) data
License: Creative Commons Zero v1.0 Universal
This code which extracts suffixes from the firstname and last name
clean() line 56
str_detect(lastname, "(?<=\\s)JR\\.?$") ~ "JR",
str_detect(lastname, "(?<=\\s)SR\\.?$") ~ "SR",
str_detect(lastname, "(?<=\\s)I\\.?$") ~ "I",
str_detect(lastname, "(?<=\\s)II\\.?$") ~ "II",
str_detect(lastname, "(?<=\\s)III\\.?$") ~ "III",
str_detect(lastname, "(?<=\\s)IV\\.?$") ~ "IV",
str_detect(lastname, "(?<=\\s)V\\.?$") ~ "V",
str_detect(lastname, "(?<=\\s)VI\\.?$") ~ "VI",
str_detect(lastname, "(?<=\\s)VII\\.?$") ~ "VII",
str_detect(lastname, "(?<=\\s)1ST\\.?$") ~ "1ST",
str_detect(lastname, "(?<=\\s)2ND\\.?$") ~ "2ND",
str_detect(lastname, "(?<=\\s)3RD\\.?$") ~ "3RD",
str_detect(lastname, "(?<=\\s)4TH\\.?$") ~ "4TH",
str_detect(lastname, "(?<=\\s)5TH\\.?$") ~ "5TH",
str_detect(lastname, "(?<=\\s)6TH\\.?$") ~ "6TH",
str_detect(lastname, "(?<=\\s)7TH\\.?$") ~ "7TH",
str_detect(lastname, "(?<=\\s)8TH\\.?$") ~ "8TH",
str_detect(lastname, "(?<=\\s)9TH\\.?$") ~ "9TH",
can be replaced with
str_match(lastname, '(?<=\s)(JR|SR|I{1,3}V?|VI{0,2}|1ST|2ND|3RD|[4-9]TH)\.?$')[2]`
Quitting from lines 282-313 (dl_report.Rmd)
Error in group_by()
:
! Must group by variables found in .data
.
x Column issue_id
is not found.
Backtrace:
I hacked the report to run it manually, removing the issue_id from the grouping and it runs, but I can't figure out what issue_id represents, and if grouping by it is necessary.
Remove code from findDuplicates that assigns Iowa dove to its own record type.. They should have shifted away from this in December 2021.
In the strataCheck function I was getting a number of rows for states that was telling me that the coot_snipe & rail_gallinule values were "bad" and that the normal strata was NA. To make this, I'm guessing that you join it on the hip_bags_ref object.. When I query the hip_bags_ref table the spp values is coots_snipe_bag, and rails_gallinules_bag, when the column names in the data are coots_snipe and rails_gallinules which is causing a join issue?
This appears to be isolated to the strataCheck function. The output files have the correct stratification for these columns, and states.
This at the moment appears to be specific to the CO and NM Band-tailed pigeon permit files.. These are uniquely different in that in addition to the permit file, there should be a dove response attached to it. This differs from the Crane files which are just a positive indicator that a crane permit was purchased.
In 2024, a record_type of PMT was attached for each of these records, when creating the output transfer file. These should have been tagged as HIP since they include "non-permit information". The impact appears that a hip registration was not created to capture the dove stratification. However, this may have been limited to those records in which the state could not match the permit to a hunter with a HIP registration, which means we would have been creating a HIP registration with a dove stratum of 0..
Options:
A. update code to just make sure these are assigned to HIP
B. Discuss whether we can do away with the record_type column altogether since I can identify what columns in what states are permit fields, and just process accordingly.
report template is missing
library(lubridate)
needed because of the call to %within%
In places where you use this code.. read_hip and one other function
list.files(path, recursive = FALSE) %>%
as_tibble() %>%
transmute(filepath = as.character(value)) %>%
mutate(filepath = str_replace(filepath, "TXT", "txt")) %>%
filter(str_detect(filepath, "(?<=\\.)txt$")) %>%
mutate(filepath = paste0(path, filepath)) %>%
can effectively be replaced with
list.files(path, recursive=TRUE, pattern= '*\\.txt', ignore.case=TRUE, full.names=TRUE) %>%
as_tibble()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.