Add futurize() option rng, which declares whether parallel random
number generation (RNG) is needed, e.g. lapply(xs, fcn) |> futurize(rng = TRUE). This supersedes option seed, which is still
supported for backward compatibility, i.e. futurize(seed = TRUE) is
equivalent to futurize(rng = TRUE). Options rng and seed must
not be specified at the same time. Currently, rng accepts only
TRUE, FALSE, and NA; other values are reserved for future
extensions.
Use futurize(rng = NA) to declare that random numbers may be
generated, but that they do not affect the results. This silences
false-positive RNG-misuse warnings without setting up parallel RNG
streams. This is equivalent to futurize(seed = NULL).
Error messages and vignettes now suggest futurize(rng = TRUE)
instead of futurize(seed = TRUE).
Add support for Bioconductor package bumphunter, e.g. bumps <- bumphunter(mat, design, chr = chr, pos = pos, cutoff = 0.5, B = 100) |> futurize().
Add support for mlr3 functions resample() and benchmark().
Add support for mlr3tuning functions tune() and
tune_nested(), when using batch tuners. Asynchronous tuners are
not supported, because they do not use futures.
Add support for new GSVA (>= 2.7.25) functions gsvaRowNorm(),
gsvaColRanks(), and gsvaColScores().
If a package required for futurization was not available, e.g.
future.apply for lapply(xs, fcn) |> futurize(), the error
message was the misleading "Function base::lapply() is not in one
of the registered futurize namespaces". This could happen during
R CMD check of a package that uses futurize without
declaring future.apply as a dependency. Now the error message
says which package is missing.
Printing a futurized call with an argument set to NULL, e.g.
futurize(lapply(xs, fcn), seed = NULL, eval = FALSE), gave an
error on "subscript out of bounds".
Futurization of GSVA functions works again, but it requires GSVA (< 2.7.0) or GSVA (>= 2.7.25).
genericFunction for S4 classes rather than
standardGeneric, which will be removed in R (>= 4.7.0).Futurizing foreach(..., .options.future = list(...)) %do% { ... }
is now an error, because %do% never supported such options in the
first place. Instead, pass future options to futurize(), e.g.
foreach(...) %do% { ... } |> futurize(seed = TRUE). Previously,
such attempts were silently ignored.
Futurization of GSVA functions will stop working with GSVA (>= 2.7.0).
res <- tile_apply(r, function(x) x * 2) |> futurize().futurize() now unwraps withCallingHandlers(), e.g.
withCallingHandlers(lapply(xs, fcn), warning = ...) |> futurize().
Futurization of lme4 functions now uses parallel = "future"
available in lme4 (>= 2.0-6). Older versions are still
supported.
Option chunk_size was ignored when futurizing times(n) %do% { ... }.
Futurize option packages would drop packages that the transpiler
declares as required on parallel workers.
Futurizing a call that specifies an argument that futurize()
sets, e.g. bplapply(xs, fcn, BPPARAM = SerialParam()), or
boot(..., parallel = "multicore"), gave an obscure error
message. Now it gives an informative error.
Futurizing a call to an S3 or S4 generic function, whose first
argument is a function call, e.g. influence(lmer(...)) |> futurize(), would evaluate that first argument twice; once to
identify the method to be called, and once more when calling it.
Now it is evaluated only once.
Attempts to futurize a generic function that dispatches to an
unsupported S3 or S4 method gave an uninformative error message,
e.g. summary(fit) |> futurize() and, with BiocGenerics
attached, lapply(x, fcn) |> futurize() for an S4Vectors
List. Now the error message names the method, its package, and
the class dispatched on.
Attempts to futurize a function not part of a package gave an obscure error message suggestion to install a non-existing package.
Attempts to futurize an expression that is not a function call,
e.g. { x } |> futurize(), gave an obscure error message.
All futurize options, e.g. seed, packages, and label, were
ignored when futurizing BiocParallel functions.
Futurizing plyr functions with argument .paropts gave an
obscure error. Now the .paropts options are passed on as-is,
unless they specify .options.future, which gives an informative
error suggesting to pass such options to futurize() instead.
Futurizing plyr functions produced a "No parallel backend
registered" warning when using a single parallel worker,
e.g. plan(sequential).
Add support for domain-specific CRAN package DiceKriging,
e.g. m <- km(~., design = design, response = response, multistart = 8) |> futurize().
Add support for domain-specific CRAN package ez, e.g. rt <- ezBoot(data = ANT, dv = rt, wid = subnum, within = .(cue, flank), between = group) |> futurize().
Add support for domain-specific CRAN package modelsummary,
e.g. tbl <- modelsummary(models) |> futurize().
Add support for domain-specific CRAN package parameters,
e.g. fit <- bootstrap_model(model, iterations = 1000) |> futurize().
Add support for domain-specific CRAN package pls, e.g. m <- plsr(density ~ NIR, ncomp = 10, data = yarn, validation = "CV") |> futurize().
Add support for domain-specific CRAN package pvclust,
e.g. fit <- pvclust(mtcars, nboot = 1000) |> futurize().
Add support for domain-specific CRAN package rugarch,
e.g. roll <- ugarchroll(spec, sp500ret, n.start = 1000) |> futurize().
Add support for domain-specific CRAN package sandwich,
e.g. v <- vcovBS(fit) |> futurize().
Add support for domain-specific CRAN package Sim.DiffProc,
e.g. res <- MCM.sde(mod1d, statistic = stat, R = 100) |> futurize().
Add support for domain-specific CRAN package SuperLearner,
e.g. res <- CV.SuperLearner(Y = Y, X = X, SL.library = SL.library) |> futurize().
Add support for map-reduce CRAN package stars, e.g. sm <- st_apply(s, MARGIN = 1, FUN = mean) |> futurize().
scuttle::perFeatureQCMetrics() instead of the deprecated
scuttle::perCellQCMetrics().futurize() did not use seed = TRUE for gamlss::gamlssCV().
futurize() on boot::censboot() would produce an error on
"parallel::clusterEvalQ() is not supported by FutureCluster
clusters. Ignoring expression: library(survival)".
Add support for descending calls wrapped in with().
Add default future labels that reflect what function call has been futurized.
Errors produced when an unsupported call is attempted now includes the version of the futurize package.
futurize(label = name) was ignored for crossmap and purrr
calls.Following the initial CRAN release in January 2026, this version adds
futurize() support for many more CRAN and Bioconductor packages. To
achieve this, support for transpiling S3 and S4 methods was added,
expanding beyond regular and generic functions. This opens the door
for futurizing many more packages going forward.
Add support for futurizing S3 methods where the S3 generic is defined in another package.
Add support for futurizing S4 methods where the S4 generic is defined in another package.
futurize() transpilation via R option
futurize.enable, which may be set via environment variable
R_FUTURIZE_ENABLE when the package is loaded.Add support for map-reduce CRAN package pbapply, e.g. y <- pblapply(...) |> futurize().
Add support for domain-specific Bioconductor package DESeq2,
e.g. dds <- DESeq(dds) |> futurize().
Add support for domain-specific Bioconductor package fgsea,
e.g. res <- fgsea(pathways, stats) |> futurize().
Add support for domain-specific Bioconductor package
GenomicAlignments, e.g. se <- summarizeOverlaps(features, bam_files) |> futurize().
Add support for domain-specific CRAN package fwb, e.g. b <- fwb(data, statistic, R = 1000) |> futurize().
Add support for domain-specific CRAN package gamlss,
e.g. cv <- gamlssCV(y ~ pb(x), data = abdom, K.fold = 10) |> futurize().
Add support for domain-specific CRAN package glmmTMB, e.g. pr <- profile(m) |> futurize().
Add support for domain-specific CRAN package kernelshap,
e.g. ks <- kernelshap(model, X = x_explain, bg_X = bg_X) |> futurize().
Add support for domain-specific Bioconductor package GSVA,
e.g. es <- gsva(gsvaParam(expr, geneSets)) |> futurize().
Add support for domain-specific CRAN package metafor, e.g. pr <- profile(fit) |> futurize().
Add support for domain-specific CRAN package partykit, e.g. cf <- cforest(dist ~ speed, data = cars) |> futurize().
Add support for domain-specific CRAN package riskRegression,
e.g. sc <- Score(list("CSC" = fit), data = d, formula = Hist(time, event) ~ 1, times = 5, B = 100, split.method = "bootcv") |> futurize().
Add support for domain-specific Bioconductor package scater,
e.g. sce <- runPCA(sce) |> futurize().
Add support for domain-specific Bioconductor package scuttle,
e.g. sce <- logNormCounts(sce) |> futurize().
Add support for Bioconductor package Rsamtools,
e.g. counts <- countBam(bamViews) |> futurize().
Add support for Bioconductor package SingleCellExperiment,
e.g. result <- applySCE(sce, perCellQCMetrics) |> futurize().
Add support for Bioconductor package sva,
e.g. adjusted <- ComBat(dat, batch) |> futurize().
Add support for domain-specific CRAN package seriation, e.g. o <- seriate_best(d_supreme) |> futurize().
Add support for domain-specific CRAN package SimDesign,
e.g. res <- runSimulation(design, replications = 1000, generate, analyse, summarise) |> futurize().
Add support for domain-specific CRAN package shapr,
e.g. result <- explain(model, x_explain, x_train, approach, phi0) |> futurize().
Add support for domain-specific CRAN package strucchange,
e.g. bp <- breakpoints(Nile ~ 1) |> futurize().
Add support for domain-specific CRAN package TSP, e.g. tour <- solve_TSP(USCA50, method = "nn", rep = 10) |> futurize().
Add support for domain-specific CRAN package vegan, e.g. md <- mrpp(dune, Management) |> futurize().
futurize() option chunk_size was silently ignored for
transpilers relying on doFuture.
futurize() failed to descend wrapped calls such as local() and
suppressWarnings() that specified additional arguments. For
example, local({ lapply( ... ) }, envir = env) |> futurize()
would produce a parsing error.
Packages not supporting specifying a random seed will now produce
an informative error message if futurize(seed = <numeric>) is
specified, e.g. boot, glmmTMB, lme4, mgcv, and
vegan.
This is the first version submitted to CRAN.
b <- bam(...) |> futurize().Add supported_packages() and supported_package_functions().
Rename argument chunk.size to chunk_size.
Add custom print() method for transpiled calls such that
attributes are displayed for arguments and their content.
Transpiler can now handle nested, complex wrapped expressions.
Error messages now suggest using %do% when trying to futurize
foreach() with %dopar% or %dofuture%.
Error messages now distinguish between infix operators
(e.g. %do%) and functions (e.g. lapply()).
{ ... }, ( ... ), local( ... ), I(), and identity(), e.g.
local({ lapply(x, f) }) |> futurize() is the same as
local({ lapply(x, f) |> futurize() }).m <- tm_map(crude, content_transformer(tolower)) |> futurize().Handle nested transpilers.
Add futurize(when = {condition}) for futurizing conditioned on an
R expression at runtime, e.g. lapply(xs, fun) |> futurize(when = (length(xs) > 10)).
Add futurize(FALSE) and futurize(TRUE) for disabling and
enabling futurizing of calls.
Add support for domain-specific CRAN package caret, e.g. model <- train(Species ~ ., data = iris, method = "rf", trControl = ctrl) |> futurize().
Add support for times() and %:% of foreach, which require
special care when it comes to passing future options,
e.g. futurize(seed = FALSE).
The default future options for futurize() are now customized such
that they work in more cases, e.g. there is no need to declare seed = TRUE for replicate(3, rnorm(1)) |> futurize().
futurize() gained argument eval, which can be used to return
the futurized expression instead of evaluating it.
The futurize package unifies our current future.apply,
furrr, and doFuture solutions into a minimal, unified
API. This means you no longer need to learn those future-specific
packages and their APIs, and all you need to know is the ... |> futurize() syntax. The default behavior of futurize() is
sufficient for most use cases and users, but, if needed, it comes with
one unifying, unique set of arguments that can be used to configure
how the futures are resolved, how they are partitioned into chunks,
and how output and conditions are relayed, among other things.
Add support for base R, e.g. y <- lapply(xs, fcn) |> futurize(),
y <- by(xs, idxs, fcn) |> futurize(), and xs <- kernapply(x, k) |> futurize().
Add support for map-reduce CRAN package purrr, e.g. y <- map(xs, fcn) |> futurize().
Add support for map-reduce CRAN package crossmap, e.g. y <- xmap_dbl(xs, fcn) |> futurize().
Add support for map-reduce CRAN package foreach, e.g. y <- foreach(x = xs) %do% { fcn(x) } |> futurize().
Add support for map-reduce CRAN package plyr, e.g. y <- llply(xs, fcn) |> futurize().
Add support for map-reduce Bioconductor package BiocParallel,
e.g. y <- bplapply(xs, fcn) |> futurize().
Add support for domain-specific CRAN package boot, e.g. b <- boot(data, statistic, R = 1000) |> futurize().
Add support for domain-specific CRAN package glmnet, e.g. cv <- cv.glmnet(x, y) |> futurize().
Add support for domain-specific CRAN package lme4, e.g. gm <- allFit(gm) |> futurize().
futurize() function
that takes a call expression to any base-R apply function and
transpiles it such that it runs in parallel via futures. This works
by transpiling the original map-reduce call to evaluate each
iteration via a lazy, vanilla future. These futures are then
partitioned into chunks, where the number of chunks defaults to the
number of parallel workers. The futures in each chunk are merged
into a single future. These futures are then launched in parallel
on the current future backend. When resolved, the results are
reduced back to the structure that the original base R apply
function would return.