Comments (2)
Definitely. I'm planning on cleaning that up in the next few days. It was getting to be a hassle. This is a nice way to do so. Thanks!
from furrr.
@hadley, I've updated furrr
to include future_options()
to build a set of options. This greatly streamlined the interface (and the docs) as we now have:
future_map(.x, .f, ..., .progress = FALSE, .options = future_options())
Thanks for the advice!
Here are a few examples of the interface in practice:
library(furrr)
#> Loading required package: future
# If you use multicore (on Mac) you can actually still access variables even though you
# don't explicitly pass them with `globals`. This has something to do with it being a forked process.
plan(multisession)
#### Selective exporting of variables
# Export only x
x <- 1
y <- 1
future_map(1, ~x) # black magic
#> [[1]]
#> [1] 1
future_map(1, ~x, .options = future_options(globals = "y")) # no magic
#> Error in ...future.f(...future.x_jj, ...): object 'x' not found
future_map(1, ~x, .options = future_options(globals = "x")) # no magic
#> [[1]]
#> [1] 1
#### Selective exporting of packages
future_map(1, ~tibble(x = 1), .options = future_options(packages = "tibble")) # no magic
#> [[1]]
#> # A tibble: 1 x 1
#> x
#> <dbl>
#> 1 1
library(tibble)
future_map(1, ~tibble(x = 1)) # magic
#> [[1]]
#> # A tibble: 1 x 1
#> x
#> <dbl>
#> 1 1
Created on 2018-05-09 by the reprex package (v0.2.0).
from furrr.
Related Issues (20)
- Error indices from purrr() are misleading in furrr()
- Getting the same random result across `purrr::map()` and `furrr::future_map()` HOT 3
- `furrr` much slower than `purrr` (on Windows) HOT 2
- Export a wrapper around purrr `map()` to workers rather than `map()` itself
- Setting `seed = TRUE` / `.progress=TRUE` globally in the R session HOT 1
- Carrier HOT 2
- mgcv::gam(~s(pc = object not found)) when future::plan(multisession, workers > 1) HOT 1
- when large matrix or df split into list, does furrr workers only access list element? HOT 1
- error: external pointer is not valid is not a particularly user actionable message HOT 5
- terra::rast() doesn't return a variable with workers > 1 HOT 3
- Understanding memory usage and performance of `furrr::future_apply` HOT 5
- Implement map_vec
- Use of variables in glue() inside furrr loops HOT 1
- Progress bar showing 100% even if not completed
- Error when plotting a {sf} object
- Identical RNG state for each task, despite setting different seeds in different tasks HOT 10
- How to pass to .f, character vectors in .x that reference global values?
- `future_map` not obviously faster than `map` in simple linear regression setting HOT 1
- Multiple calls of future_map() within a single plan() or script result in massive slowdown.
- furrr_options documentation doesn't say what to do with it
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from furrr.