r - using future_lapply() inside future_lapply()
问题描述
I am iterating over a function that uses future_lapply()
. I want to parallelize the outside lapply, for which I would use the following code:
plan(multisession, workers = 10)
future_lapply(X = 1:10, FUN = myfun)
Now, myfun()
has its own future_lapply()
inside. How do I configure the plan inside myfun()
so that it does not mess up with the outside plan?
Inside myFun()
, I am using
o.plan <- plan()
plan(sequential)
on.exit(plan(o.plan), add = TRUE)
Is this the correct approach?
解决方案
推荐阅读
- json - 我无法在 React Native 中返回解析信息
- python - 如何在 Python Kivy 应用程序中打开 pdf?
- asp.net - ASP.NET Core 会话超时
- html - Django:如果我开始一个表,然后有一个 {% block %}{% endblock %} 并在之后关闭表,它会破坏表吗?
- javascript - 单击单选按钮时如何处理?
- android - 安卓。图像视图未在某些设备上显示
- lua - Roblox Lua 错误值不是 Player 的有效成员,但我不尝试访问它
- nginx - EC2 上的 MLflow 跟踪
- symfony - JMSSerializer hasData 已弃用
- r - 如何在R中旋转包含带有部分和子部分的列的数据框