James-Thorson/FishData

Error on WCGHL query with hour and minute columns missing

Opened this issue · 1 comments

Regarding the Google doc, I can't remember what issue I was facing at the time, but I tried running the readme examples and ran into the following issue:

Database = FishData::download_catch_rates( survey="WCGHL", species_set="Sebastes paucispinis" )
Error in `[.data.frame`(WCGHL_data, , "sampling_end_time_dim$military_hour") : 
  undefined columns selected
traceback()
...
6: `[.data.frame`(WCGHL_data, , "sampling_end_time_dim$military_hour")
5: WCGHL_data[, "sampling_end_time_dim$military_hour"]
...
2: cbind(WCGHL_data, soak_time = WCGHL_data[, "sampling_end_time_dim$military_hour"] * 
       60 + WCGHL_data[, "sampling_end_time_dim$minute"] - (WCGHL_data[, 
    ...
1: FishData::download_catch_rates(survey = "WCGHL", species_set = "Sebastes paucispinis")

I.e., related to this line where military_hour and minute are missing:

WCGHL_data = cbind( WCGHL_data, "soak_time"=WCGHL_data[,'sampling_end_time_dim$military_hour']*60+WCGHL_data[,'sampling_end_time_dim$minute']-(WCGHL_data[,'sampling_start_time_dim$military_hour']*60+WCGHL_data[,'sampling_start_time_dim$minute']))

I assume the input data format has changed.

Thanks for flagging this! It's super helpful to keep a record of these issues as you know :)

I think this is a good example of the importance of either:

  • getting buy-in (and in-kind labor contributions) from regional collaborators to keep pace with regional database changes; OR
  • interfacing with a higher-level API (like DisMAP) that can provide some assurance of keeping up with changes appropriately.