emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matthew Landis <landis@isciences.com>
To: Christophe Pouzat <christophe.pouzat@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Selectively export RESULTS
Date: Fri, 02 Mar 2012 13:53:48 -0500	[thread overview]
Message-ID: <4F51173C.5010308@isciences.com> (raw)
In-Reply-To: <874nu6lw91.fsf@xtof-netbook.home>



On 3/2/2012 12:59 PM, Christophe Pouzat wrote:
>
> Matthew,
>
> I think that you're wrongly expecting babel's cache header argument to
> behave like the argument of the same name in Sweave code chunks. Babel
> will cache, in your case, the value of your code block evaluation and
> there is none in your first code block, therefore nothing gets cached by
> babel, try that instead:
>
> #+name: my-random-vector
> #+begin_src R :session :cache yes
> rnorm(100)
> #+end_src
>
> #+headers: :var x=my-random-vector
> #+headers: :results graphics :exports results :file hist.png
> #+begin_src R :session  :cache yes
> hist(x)
> #+end_src
>
> Does it work better? In that case you don't even need a session.
>
> Christophe
Christophe - thanks for the suggestion.  I haven't messed around much 
with variables passed between code blocks.  When I try this, R tells me 
that 'x' must be numeric.  When I query x in the R buffer, x is a 
data.frame.  So the second code block reads x in as a data.frame instead 
of a numeric vector.

For most purposes this would be OK (since a data.frame is the most usual 
outcome), but I'm reluctant to use this approach -- I'd like all of the 
variable passing to be in the R session.  Intuitively this seems 
simpler, less error prone, and more conducive to tangling later.  (Of 
course, I could be totally wrong - since I haven't really tried that 
approach).

M

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~
Matthew Landis, Ph.D.
Research Scientist
ISciences, LLC
61 Main St. Suite 200
Burlington VT 05401
802.864.2999
www.isciences.com
~~~~~~~~~~~~~~~~~~~~~~~~~~

      reply	other threads:[~2012-03-02 18:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-29  5:04 Selectively export RESULTS cberry
2012-02-29  7:05 ` Thomas S. Dye
2012-02-29 16:50   ` cberry
2012-02-29 17:06     ` Eric Schulte
2012-02-29 20:24       ` cberry
2012-03-02 17:24         ` Matthew Landis
2012-03-02 17:48           ` Eric Schulte
2012-03-02 18:33             ` Matthew Landis
2012-03-02 19:33               ` Eric Schulte
2012-03-02 20:12                 ` Matthew Landis
2012-03-02 20:20                   ` Eric Schulte
2012-03-03 10:43                     ` Sebastien Vauban
2012-03-03 14:52                       ` Achim Gratz
2012-03-03 23:01                         ` Sebastien Vauban
2012-03-04 10:37                           ` Achim Gratz
2012-03-04 20:44                             ` Sebastien Vauban
2012-03-02 19:42             ` cberry
2012-03-02 20:26               ` Eric Schulte
2012-03-02 21:08               ` cberry
2012-03-02 21:26                 ` Nick Dokos
2012-03-02 21:35                   ` cberry
2012-03-02 23:01                     ` Nick Dokos
2012-03-02 17:59           ` Christophe Pouzat
2012-03-02 18:53             ` Matthew Landis [this message]

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=4F51173C.5010308@isciences.com \
    --to=landis@isciences.com \
    --cc=christophe.pouzat@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).