Repository navigation
Fix build ntrans - #21
Open
benjaminhlina wants to merge 6 commits into
Open
benjaminhlina wants to merge 6 commits into
benjaminhlina wants to merge 6 commits into
Conversation
…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()`
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
build_ntrans()would look attime_bincolumn 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 thetime_binwere not sequential such as2026-10-07 08:00:00and2026-10-07 10:00:00. In this example it would end up determining the number of ntrans for two hours even thoughbuild_time_bin()set to 1 hour has createdtime_binsto 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 thedata.frameis pased tobuild_ntrans()it uses the columntime_bin_unitto 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