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.

master
Erik de Vries 4 years ago
parent 9419d6dc08
commit 8875630235

@ -141,7 +141,7 @@ sent_merger <- function(df, actors_meta = NULL, actor_groups = NULL, pos_cutoff
## Create aggregate measures for individual actors ## 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 = sum(sent_binary_weighted)/sum(words),
actor.sent_words = sum(sent_words), actor.sent_words = sum(sent_words),
actor.words = sum(words), actor.words = sum(words),

Loading…
Cancel
Save