NewGraphEnvironment / dff-2022

Building digital field forms and processing data collected using R, postgresql, QGIS and other tools
Creative Commons Zero v1.0 Universal
0 stars 3 forks source link

Fhap form build, added extra fields to fish sampling form #132

Closed Mateo9569 closed 1 year ago

Mateo9569 commented 1 year ago

Scripts and Q files for new fhap form. I also added some extra fields to the fish form (ex: electrofisher settings, pass, sampling method). And I added some default values as well, like in the tag number field. So you would only have to fill in the last few digits that actually change.

Mateo9569 commented 1 year ago

i will pull so that we can move on but it is important to know your template and research/use what we did already in our past repos (recent elk report with you as an author) so that you leverage forward work that has already been done.

this and the functions.R files were key for this work. https://github.com/NewGraphEnvironment/fish_passage_elk_2022_reporting/blob/main/scripts/tidy_fhap.R

I was mostly focused on the build of the form and overall testing. That tidy script is something I just copied and pasted over quickly and ran once briefly so I could see how it all looks in R. I will definitely use everything from the elk repo now. I didn't forget about it!

NewGraphEnvironment commented 1 year ago

the tidy script is key to reading in the template and assign column names. Its already done. No need to look at blackwater

##---------------- Import fhap_habitat_units-----------------
fhap_hu_raw <- readxl::read_excel(
  'data/FHAP.xlsx',
  sheet = 'hab_units',
  skip = 1,
  # need to leave the col names in at first so we select all the data
  col_names = T,
  col_types = xref_fhap_hu %>% dplyr::pull(type_readxl)
) %>%
  purrr::set_names(nm = xref_fhap_hu %>% pull(spdsht)) %>%
  mutate(location_waypoint = stringr::str_pad(location_waypoint, 3, pad = "0"))
NewGraphEnvironment commented 1 year ago

functions.R has all the names of everything already ready to go too