Revision | fb00af179b09110fced32d82abb532744f8a88d1 (tree) |
---|---|
Time | 2022-09-30 16:15:21 |
Author | Lorenzo Isella <lorenzo.isella@gmai...> |
Commiter | Lorenzo Isella |
I added a parallel version of the function to look for a list of keywords.
@@ -6986,3 +6986,23 @@ | ||
6986 | 6986 | return(res) |
6987 | 6987 | |
6988 | 6988 | } |
6989 | + | |
6990 | +### Now its parallel version. It needs library(furrr) and something like | |
6991 | + | |
6992 | +## n_cores <- 2 | |
6993 | + | |
6994 | +## plan(multicore(workers=return_cores(n_cores))) | |
6995 | + | |
6996 | + | |
6997 | +## to be able to use multiple cores. | |
6998 | + | |
6999 | +find_text_multiple_keywords_exact_matches_future <- function( df, keywords){ | |
7000 | + | |
7001 | + res <- future_map_dfr(keywords, | |
7002 | + function(x) find_text_filter_exact_matches(df, x) , | |
7003 | + .progress =T) | |
7004 | + | |
7005 | + return(res) | |
7006 | + | |
7007 | +} | |
7008 | + |