diff --git a/R/actor_merger.R b/R/actor_merger.R index e45f5e5..21af375 100644 --- a/R/actor_merger.R +++ b/R/actor_merger.R @@ -37,6 +37,7 @@ actor_merger <- function(df, actors_meta, ids = NULL) { text_sent <- df %>% select(`_id`,starts_with("text."),-ends_with("sent_lemmas")) df <- df %>% + ungroup() %>% select(-ends_with("sent_lemmas"),-starts_with("text.")) %>% unnest(cols = colnames(.)) ## Unnest to sentence level @@ -170,7 +171,8 @@ actor_merger <- function(df, actors_meta, ids = NULL) { yearmonth = strftime(publication_date, format = '%Y%m'), yearmonthday = strftime(publication_date, format = '%Y%m%d'), yearweek = strftime(publication_date, format = "%Y%V") - ) + ) %>% + ungroup() return(df) } } diff --git a/R/sentencizer.R b/R/sentencizer.R index cf523b6..85747d7 100644 --- a/R/sentencizer.R +++ b/R/sentencizer.R @@ -126,7 +126,8 @@ sentencizer <- function(out, sent_dict = NULL, localhost = NULL, validation = F) out <- out %>% summarise_all(list) %>% left_join(.,text_sent,by='_id') %>% - left_join(.,metadata,by='_id') + left_join(.,metadata,by='_id') %>% + ungroup() return(out) } saveRDS(par_sent(1:nrow(out),out = out, sent_dict=sent_dict), file = paste0('df_out',as.numeric(as.POSIXct(Sys.time())),'.Rds'))