Skip to content

Commit

Permalink
add a measure of word count of cleaned utterances for each turn
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Sacks committed Nov 15, 2023
1 parent fe2cfa4 commit 484c30f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/clean_dyads.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ clean_dyads <- function(read_ts_df, lemmatize=TRUE) {

dfclean_filtered <- dfclean_sep %>% #remove rows where text is an empty string
dplyr::filter(cleantext != "") %>%
#new stuff for testing the word count analytic fun
dplyr::group_by(event_id) %>% #add a turn count per dyad, which counts by speaker change
dplyr::mutate(turncount = dplyr::consecutive_id(Participant_ID), .before = 1) %>%
dplyr::group_by(turncount, .add = TRUE) %>%
mutate(wordcount_clean_turn = n()) %>% # take the word count of cleaned utterances at each turn
dplyr::ungroup()

return(dfclean_filtered)
Expand Down

0 comments on commit 484c30f

Please sign in to comment.