Skip to content

Fix build ntrans - #21

Open
benjaminhlina wants to merge 6 commits into
mainfrom
fix-build-ntrans
Open

benjaminhlina wants to merge 6 commits into
mainfrom
fix-build-ntrans

Conversation

@benjaminhlina

Copy link
Copy Markdown
Collaborator

build_ntrans() would look at time_bin column and determine the time difference between time bins and calculate the number of transmissions within that given time difference. This would lead to issues if the the time_bin were not sequential such as 2026-10-07 08:00:00 and 2026-10-07 10:00:00. In this example it would end up determining the number of ntrans for two hours even though build_time_bin() set to 1 hour has created time_bins to aggreagte over detections across 1 hour time intervals.

The fix here was to make the unit value come through when build_time_bin() is run. Then when the data.frame is pased to build_ntrans() it uses the column time_bin_unit to determine the number of expected transmisisons within a given time bin. For example 1 hour (3600 sec) with a tag having mean delay of 240 s would expect 15 transmisisons

…uential then it calculates between each time_bin which isn't what we need we need it to be the ntrans within a time_bin. Hot fix for now is to use `dplyr::first()` but this needs to be simplified.
… of transmissions within a given time_bin this now relies on `lubridate::duration()`
@benjaminhlina
benjaminhlina requested a review from mhpob October 7, 2026 15:36
@benjaminhlina benjaminhlina self-assigned this Oct 7, 2026
@benjaminhlina benjaminhlina added the bug Something isn't working label Oct 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant