Re: [O] creating a list from an R source block
Thanks, that works. But does this count as a bug in ob-R? Greg On Sep 5, 2012, at 12:55 AM, John Hendy wrote: > On Tue, Sep 4, 2012 at 11:42 AM, Greg Tucker-Kellogg > 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 >> >>
Re: [O] creating a list from an R source block
On Tue, Sep 4, 2012 at 11:42 AM, Greg Tucker-Kellogg 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 > >
[O] creating a list from an R source block
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") 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