How do I document parallel computations within knitr implemented in Rstudio?

这一生的挚爱 提交于 2020-01-05 09:04:40

问题


I'm coding an agent-based simulation. I plan to run parallel instances of the simulation to reduce computing time. I will use the parallel package. I want to document my code using knitr. Before I start, I'd like to confirm whether there will be any issues running the parallel package's functions from within a Markdown or Sweave document that I compile with knitr.


回答1:


It works...

Parallel Example in RStudio as run via knitr after being written in R markdown...

```{r parallel-do}
library(foreach)
library(parallel)
library(doParallel)
demo(sincParallel)
````

See output on Rpubs::

http://rpubs.com/Thell/6679



来源:https://stackoverflow.com/questions/17243756/how-do-i-document-parallel-computations-within-knitr-implemented-in-rstudio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!