ocean-tracking-network / glatos

9 stars 4 forks source link

transmitter_codespace column in read_otn_detections causes problems for false_detections #183

Closed jackVanish closed 1 year ago

jackVanish commented 1 year ago

Running into an issue when I run the following code:

detection_events <- #create detections event variable read_otn_detections('hfx_qualified_detections_2022.csv') %>% # reading detections false_detections(tf = 3600) #%>% #find false detections

The read_otn_detections part is fine, but when I pass through to false_detections, I get this error: Error in setkeyv(x, cols, verbose = verbose, physical = physical) : Column 'transmitter_codespace' is type 'list' which is not supported as a key column type, currently.

Indeed, when I inspect the loaded variable, the transmitter_codespace column appears as in the attached screenshot (a snapshot of all the columns in the RStudio inspector panel).

Screen Shot 2023-10-06 at 1 05 31 PM

I'm not sure if this is a problem with my data or the code. I assume it has to do with the read_otn_detections function adding the codespace column with the output of purrr::map(), but I'm not sure.

jackVanish commented 1 year ago

An update; the root of this seems to be a mistake on my part. I was using a file containing 'qualified' detections (all detections on the array) rather than a file containing matched detections (all the places the fish went), so presumably there was some underlying hiccup with the file structure that caused purrr::map() to pop out the wrong info. Potentially something to be aware of in the future, but not causing problems for us right now (I don't think).

jdpye commented 1 year ago

Seems related to #127 , let's track this over there.