emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Hendy <jw.hendy@gmail.com>
To: Greg Tucker-Kellogg <gtuckerkellogg@gmail.com>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: creating a list from an R source block
Date: Tue, 4 Sep 2012 11:55:10 -0500	[thread overview]
Message-ID: <CA+M2ft_5A98=Mr7RpGVmyHr2M-qMsN=P0eGJcoBrPgYk3eTJRQ@mail.gmail.com> (raw)
In-Reply-To: <54669FE1-F079-41EB-8C6A-9817A0F36E35@gmail.com>

On Tue, Sep 4, 2012 at 11:42 AM, Greg Tucker-Kellogg
<gtuckerkellogg@gmail.com> 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
>
>

  reply	other threads:[~2012-09-04 16:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04 16:42 creating a list from an R source block Greg Tucker-Kellogg
2012-09-04 16:55 ` John Hendy [this message]
2012-09-04 22:43   ` Greg Tucker-Kellogg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+M2ft_5A98=Mr7RpGVmyHr2M-qMsN=P0eGJcoBrPgYk3eTJRQ@mail.gmail.com' \
    --to=jw.hendy@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=gtuckerkellogg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).