actor_fetcher: Updated to tidyr 1.0.0, no longer using preserve, slightly different approach to keeping ids_list, and not removing actorsDetail anymore because it does not exist

master
Your Name 5 years ago
parent a01a53f105
commit e76a914dd2

@ -105,10 +105,9 @@ actor_fetcher <- function(out, sent_dict = NULL, cores = 1, localhost = NULL, va
### Unnest out_row to individual actor ids ### Unnest out_row to individual actor ids
out_row <- out_row %>% out_row <- out_row %>%
unnest(`_source.computerCodes.actorsDetail`, .preserve = colnames(.)) %>% unnest(`_source.computerCodes.actorsDetail`) %>%
unnest(ids, .preserve = colnames(.)) %>% mutate(ids_list = ids) %>%
rename(ids_list = ids) %>% unnest(ids) %>%
rename(ids = ids1) %>%
mutate( mutate(
pids = str_sub(ids, start = 1, end = -3) pids = str_sub(ids, start = 1, end = -3)
) )
@ -166,7 +165,7 @@ actor_fetcher <- function(out, sent_dict = NULL, cores = 1, localhost = NULL, va
yearmonthday = strftime(`_source.publication_date`, format = '%Y%m%d'), yearmonthday = strftime(`_source.publication_date`, format = '%Y%m%d'),
yearweek = strftime(`_source.publication_date`, format = "%Y%V") yearweek = strftime(`_source.publication_date`, format = "%Y%V")
) %>% ) %>%
select(-`_source.computerCodes.actorsDetail`, select(#-`_source.computerCodes.actorsDetail`,
-`_score`, -`_score`,
-`_index`, -`_index`,
-`_type`, -`_type`,

Loading…
Cancel
Save