BergelsonLab / BergelsonLab/blabr

clean up get_lena_speaker_stats

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

Description

Due to peculiarities of its files (or my code, not sure), there are extra NA.

See aclew.R in ACLEW_correllations in vihi_sample in one_time_scripts to see what actually happens there.

```
add_its_stats(add_stats_function = get_lena_speaker_stats) %>%
# Sometimes some numeric columns in its files (as read by rlena) are
# inexplicably NA instead of zero ¯\_(ツ)_/¯. We'd rather have zeros there
# unless it is a fully NA row signifying an interval with no LENA segments.
mutate(across(c(adult_word_count, utterance_count, segment_duration),
~ if_else(is.na(spkr), true = .x,
false = replace_na(.x, 0)))) %>%
```

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.