Johannes Rainer <johannes.rainer <at> gmail.com> writes: > > > hi all! > > I have some pretty calculation intense R code in a code block and when I > execute the code (C-c C-c) my emacs freezes and waits for the code to > finish. Is there a way to evaluate the code asynchronously, so that I > could edit the file (obviously not the code block itself) while the code > is being evaluated? > > thanks, jo >
Try this: C-c ' in the R src block. Then use C-c C-c (ess-eval-region-or-function-or-paragraph-and-step) to execute the long running code from the ESS edit buffer. You may need to select the region if there are several paragraphs, or delete any blank lines. == Another alternative is to use ravel. https://github.com/chasberry/orgmode-accessories Create a knitr or Sweave doc from the org doc or a suitable subtree of the computationally intensive parts. Then you can knit() the doc from the R session and switch back to the buffer you want to edit. Also, you might want to turn on caching in the knitr doc to enable a quick restart when you log in again.