Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean up get_lena_speaker_stats #26

Open
kalenkovich opened this issue Sep 14, 2022 · 0 comments
Open

clean up get_lena_speaker_stats #26

kalenkovich opened this issue Sep 14, 2022 · 0 comments
Assignees

Comments

@kalenkovich
Copy link
Contributor

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)))) %>%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant