I have a table in org-mode that I want to pass into an R source block and then plot from it. When I write everything in org-mode and execute it, I get the results that I expect.
However, when I enter the ESS editing mode/org-edit-src-code
by toggling C-c '
inside the source block, the variable is not used. This is important for complicated scripts where I have to test multiple things and feed multiple variables/tables into the source block.
Here is an example:
#+name: test-table
| Cell | Value |
|------+-------|
| 1 | 10 |
| 2 | 20 |
| 3 | 60 |
| 4 | 80 |
| 5 | 100 |
#+name: test-table-plot
#+BEGIN_SRC R :var test=test-table :results output graphics :exports results :file-ext png
plot(test)
#+END_SRC
If I run this source block, I get the plot I expect. If I go into the org-edit-src-code
with C-c '
the table "test" does not exist.
Is this meant to be like this? Is there a way to pass the variable to org-edit-src-code
?