BergelsonLab / BergelsonLab/blabr

rewrite fixations_to_timepoints (fka binifyFixations) using join_by

Open
#44 2 comments 0 reactions 1 assignee Claimed by @kalenkovich View on GitHub
Dominant language
R
Stars
1
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Note: `fixations_to_timepoints` isn't yet implemented at all.

```r
t_series <- fixations %>%
summarise(t_min = min(current_fix_start),
t_max = max(current_fix_end)) %>%
mutate(across(c(t_min, t_max),
~ floor(. / bin_size) * bin_size)) %>%
mutate(t = list(seq(t_min, t_max, by = bin_size))) %>%
select(t) %>%
unnest(cols = t)

t_series %>%
inner_join(
fixations %>%
mutate(across(c(current_fix_start, current_fix_end),
~ floor(. / bin_size) * bin_size)),
by = join_by(between(t, current_fix_start, current_fix_end))
)
```

# Update June 7 2024

The main part (speeding up by switching to a join) was done in a632aa0f.
- [ ] Check the stuff from the [comment below](https://github.com/BergelsonLab/blabr/issues/44#issuecomment-2099209749)
- [ ] see a632aa0f's message for how the function can be further sped up.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.