Questions tagged [furrr]

This tag addresses the R package furrr intended to simplify the combination of purrr’s family of mapping functions.

This tag addresses the R package furrr intended to simplify the combination of purrr’s family of mapping functions.

68 questions
2
votes
0 answers

Output to console in run-time from future_map

I have following code which is supposed to run in parallel with furrr. plan(multisession) 1:10 %>% furrr::future_map(function(x) { print("Start") Sys.sleep(1) print("End") x }, .progress = TRUE) By specifying .progress = TRUE I can…
vkolesnik
  • 367
  • 2
  • 13
2
votes
1 answer

Pass data.frame row-wise to function using purrr/furrr instead of apply

Question:: What is the equivalent purrr/furrr function for apply, which takes a data-frame and row-wise feeds it to a function? Context:: I have a data.frame of parameter combinations: n=10 parameters <- data.frame( lam = runif(n = n, min = .35,…
HCAI
  • 2,213
  • 8
  • 33
  • 65
2
votes
1 answer

I get an error when using {future} and {furrr} functions within a Golem Shiny App, what does it come from?

I am currently working on a Golem Shiny App called "package_name" (which is a requirement for me) for which some functions I created need to use functions from the {furrr} and {future} packages. However, whenever I try to run them, I get the…
2
votes
0 answers

How to split dataframe for future_map for optimal performance

I am running a data preparation script which involves a step in which the rows of the dataframe are split up into multiple observations. This step takes quite some time and I'm trying to optimize the use of future to get some improvements. The…
arohland
  • 96
  • 6
2
votes
2 answers

R furrr: authenticate an API on each future process before running the computation

I am running a parallel computation using furrr in R. The computation require access to a web API and an authentication needs to take place. If I run a parallel process, each process needs to authenticate. In the below, I have 6 processes. So I…
Courvoisier
  • 904
  • 12
  • 26
2
votes
3 answers

Using tidy evaluations with furrr

I want to make the following function run in parallel using the furrr package instead of the purrr package. library(furrr) library(tidyverse) input <- list(element1 = tibble::tibble(a = c(1, 2), b = c(2, 2)), element2 =…
jpquast
  • 333
  • 2
  • 8
2
votes
1 answer

Run purrr::map_dfr on dataframe rows?

Given a dataframe, say iris default, how to configure purrr::map_dfr() function to run on each row of the dataframe and perform function foo. Here is one row of my df, please take into account that value is always a large JSON: structure(list(Key =…
SteveS
  • 3,789
  • 5
  • 30
  • 64
1
vote
0 answers

Is there a new way to estimate STMs of varying topic numbers with furrr now?

A year ago, I fitted an stm using code from a Julia Silge blog post. Code is posted below. After some updates to the furrr package, the code no longer runs and, when it doesn't throw an error, it crashes my computer. Is anyone aware of a…
sara_codes
  • 31
  • 2
1
vote
1 answer

Is it possible to speed this function using dplyr and furrr up?

I have a data frame where rows correspond to documents and columns capture individual words in those documents. library(tidyverse) library(furrr) #> Loading required package: future doc_by_word_df <- structure(list( doc_id = c("doc1.txt",…
avgoustisw
  • 213
  • 1
  • 7
1
vote
2 answers

appending tibbles using purrr::map

Background I wrote a function using map2 that aims to produce a dataframe or a list of dataframes. My problem is that this function produces individual tables that are not assigned to an object. My desired output is a dataframe which stores the…
prayner
  • 393
  • 1
  • 10
1
vote
2 answers

Map a function to a specific element of all sub-lists within a list conditionally - R

Task: I would like to apply a function conditionally with ifelse to a specific element across all sub-lists within a named list in R. I would like to store this output in a named list. Additionally, how can I extract the elements in the sub-lists…
Buzz B
  • 75
  • 7
1
vote
1 answer

furrr doesn't resolve S3 generic methods automatically from global environment

I have developed some code which use a lot of local functions and S3 methods. When I have started using S3 methods in furrr functions, autodetection of global variables is not working properly for detection of S3 handler. Sample code: test <-…
vkolesnik
  • 367
  • 2
  • 13
1
vote
0 answers

Poor speed gain in using `future` for parallelization

I find that the speed gain in using the future (and furrr) package for parallelization in R is not satisfactory. In particular, the speed improvement is not close to linear. My machine has 4 workers, so I thought the speed gain should be around…
rick
  • 63
  • 6
1
vote
2 answers

fuzzy and exact match of two databases

I have two databases. The first one has about 70k rows with 3 columns. the second one has 790k rows with 2 columns. Both databases have a common variable grantee_name. I want to match each row of the first database to one or more rows of the…
1
vote
0 answers

How to parallelize alpha in glmnet function (and not cv.glmnet)

I am going to use a penalized regression model from the glmnet package on a panel dataset. Being panel means that I will test the model not with cross validation but with rolling origin, so I will not use the cv.glmnet function, that works only with…