inbo / camtraptor

Camtraptor is an R package to read, explore and visualize Camera Trap Data Packages (Camtrap DP)
https://inbo.github.io/camtraptor/
MIT License
10 stars 2 forks source link

taxonIDReference not found in metadata arises error in other functions #292

Closed damianooldoni closed 11 months ago

damianooldoni commented 11 months ago

Bug found by @jimcasaer, while using map_dep():

kaart_ever_2023 <- camtraptor::map_dep(GMU8, pred_and(pred_gte("start", start_date), pred_lte("end", end_date)), feature = "rai", species = "Sus scrofa", cluster = FALSE, zero_values_icon_size = 5, max_scale = 80, relative_scale = FALSE, radius_range = c(2,10))
Error in `dplyr::select()`:
! Can't subset columns that don't exist.
✖ Column `taxonIDReference` doesn't exist.
Backtrace:
 1. camtraptor::map_dep(...)
 7. dplyr:::select.data.frame(., -c("taxonID", "taxonIDReference"))
 Show Traceback
Error in dplyr::select(., -c("taxonID", "taxonIDReference"))

While debugging, found that function check_species() uses get_species() output. This output contains taxonomic information from the $taxonomic metadata slot. The column taxonIDReference is not present anymore in such output and this arises an error in check_species().

This issue will be solved immediately.