inbo / etn

R package to access data from the European Tracking Network
https://inbo.github.io/etn/
MIT License
6 stars 5 forks source link

`get_tags()` fails on `tag_serial_number` with comma as output by `get_animals()` #288

Open PietrH opened 11 months ago

PietrH commented 11 months ago

In #287 it was suggested passing the tag_serial_number from get_animals() to get_tags instead of having comma separated serial_tag_number values when there are multiple sensors per tag.

Example of comma seperated values:

get_animals() %>% filter(stringr::str_detect(tag_serial_number, ","))
animal_id animal_project_code tag_serial_number
2779 2013_albertkanaal 1278974,1278974
2780 2013_albertkanaal 1278975,1278975
2781 2013_albertkanaal 1278976,1278976
2782 2013_albertkanaal 1278977,1278977
2783 2013_albertkanaal 1278978,1278978

However, you can't pass such a tag_serial_number to get_tags() directly at the moment:

get_tags(tag_serial_number = "1278974,1278974")

#> Error: Can't find tag_serial_number `1278974,1278974` in: 02BR 7329, 02BS 7330, 02BT 7331, 02BU 7332, 02BV 7333, 02BW 7334, 02BX 7335, 02BY 7336, 02BZ 7337, 02C0 7338, 02C1 7339, 02C2 7340, 02C3 7341, 02C4 7342, 02C5 7343, 02C6 7344, 02C7 7345, 02C8 7346, 02C9 7347, 02CA 7348, 02CB 7349, 02CC 7350, 02CD 7351, 02CE 7352, 02CF 7353, 02CG 7354, 02CH 7355, ...

Because they are passed, and compared as strings, not vectors.