From 8875630235bd9b3853b11dd266c07c489d8f5599 Mon Sep 17 00:00:00 2001 From: Erik de Vries Date: Sat, 8 May 2021 11:20:20 +0200 Subject: [PATCH] fixed actor metadata generation as well, because the same actorId might occur multiple times in a sentence, if that actor has multiple functions during the same period. --- R/sent_merger.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/sent_merger.R b/R/sent_merger.R index 7baaae9..88bd46c 100644 --- a/R/sent_merger.R +++ b/R/sent_merger.R @@ -141,7 +141,7 @@ sent_merger <- function(df, actors_meta = NULL, actor_groups = NULL, pos_cutoff ## Create aggregate measures for individual actors - actors <- df[str_starts(ids, 'A_'), + actors <- df[str_starts(ids, 'A_')] %>% .[!duplicated(.,by = c('id','ids','sentence_id')), .(actor.sent = sum(sent_binary_weighted)/sum(words), actor.sent_words = sum(sent_words), actor.words = sum(words),