[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] creating a list from an R source block
From: |
John Hendy |
Subject: |
Re: [O] creating a list from an R source block |
Date: |
Tue, 4 Sep 2012 11:55:10 -0500 |
On Tue, Sep 4, 2012 at 11:42 AM, Greg Tucker-Kellogg
<address@hidden> wrote:
> Creating a list in Org from a Ruby Array is trivial
>
> #+BEGIN_SRC ruby :exports results :results value list
> ["x" , "y", "z" ]
> #+END_SRC
>
> #+RESULTS:
> - x
> - y
> - z
>
>
> But trying the same thing from R gives a surprising (to me) result
>
> #+BEGIN_SRC R :exports results :results value list
> c("x","y","z")
> #+END_SRC
>
> #+RESULTS:
> - ("x")
> - ("y")
> - ("z")
>
Clunky, perhaps, but this works:
#+BEGIN_SRC R :exports results :results output org
a <- c("x","y","z")
cat(paste("-", a), sep="\n")
#+END_SRC
#+RESULTS:
#+BEGIN_ORG
- x
- y
- z
#+END_ORG
Best regards,
John
>
> removing the list header creates a table, but there seems to be no
> straightforward way in R to create a list of elements that is treated by Org
> as a list. Am I missing something?
>
> Greg
>
>