> On Sep 6, 2020, at 4:32 AM, Damien Cassou <dam...@cassou.me> wrote:
> 
> 
> Hi,
> 
> it seems that, if a cell within a table contains a space, the
> corresponding value passed as parameter to a R script will be
> wrong.


Not exactly. Your ECM has one column, and using both columns removes the issue.

Here is another ECM that illustrates the bug:

#+begin_src R :results output :var accounts=(identity '("A B" "C")) 
print(accounts)
#+end_src


The bug is in `org-babel-R-assign-elisp' which attempts to get the number of 
elements in each line of a table, but when the table has just one row or column 
it gets this wrong.


> Please find a very simple org file attached to this email. I
> expect the length of the variable to be 2 (which is the length of '("A
> B" "C") and not 3. Apparently, R receives this array instead: '("A B"
> "C" nil).
> 

Actually the length should be 1, i.e. a data.frame with a single column of two 
elements.

BTW, C-c C-v C-v with point in the src block will show you what R `receives'.

Unfortunately, there are other cases where the variable assignment does not 
work seamlessly for R src blocks.  There are workarounds, but they are ungainly 
- like using a src block for another language to render the table and then 
using a noweb reference to it to import the data. 

HTH,
Chuck

Reply via email to