BergelsonLab / BergelsonLab/blabr

add `expect_column_hashes_to_be_equal` to `test-helpers.R`

Open
#20 0 comments 0 reactions 1 assignee Claimed by @kalenkovich View on GitHub
might already be done refactor
Dominant language
R
Stars
1
Forks
3
PR merge metrics
No merged PRs in 30d

Description

The following pattern is used too many times not to be factored out to a function:

```r
library(digest)

hashes_list <- speaker_stats %>%
summarise(across(everything(), digest)) %>%
as.list
expected_hashes_list <-
list(
interval_start = "75ff43e40a186ae138dc9b709b691a45",
interval_end = "5e39906727aa950a55bff1f80d4226bb",
spkr = "8b19ab3ad09943f2c807002c40ebe943",
adult_word_count = "a3dd76d9042133d4ee0a6ccbc654ba48",
utterance_count = "d36f09f3bbada305d0925623a9ffb990",
segment_duration = "178fa344206b188de05bea4f07fe2b50"
)
expect_equal(hashes_list, expected_hashes_list)
```

I think a good place for this function is `R/test-helpers.R` but check `r-pkgs` first.

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.