emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Greg Slodkowicz <gregs@ebi.ac.uk>
Cc: emacs-orgmode@gnu.org
Subject: Re: R plots always exported to Rplots.pdf
Date: Wed, 22 May 2013 07:18:32 -0600	[thread overview]
Message-ID: <87zjvnqazk.fsf@gmail.com> (raw)
In-Reply-To: CAGY-8BJfgaDsAg9tgCehn+TRENXWcB0W7H1mFsJjE0eEJ1XOww@mail.gmail.com

[-- Attachment #1: Type: text/plain, Size: 775 bytes --]

Greg Slodkowicz <gregs@ebi.ac.uk> writes:

> Hi,
> I'm trying to generate a report with R plots using org-mode but no matter
> what header arguments are you the generated files are always called
> Rplots.pdf
>
> This is what my code block looks like:
>
> #+NAME: pvals_waw
> #+BEGIN_SRC R :file fig1.png :exports results
> pvals = read.table("waw_data.txt", header=T)
> plot(pvals$pvalue, pvals$length)
> #+END_SRC
>
> after evaluating the code block I get
>
> #+RESULTS: pvals_waw
> [[file:fig1.png]]
>
> but I can see that the plot is in Rplots.pdf so subsequent attempt to
> export Latex/PDF fail.  I'm using org 20130522 and R 3.0.
>
> Best,
> Greg

The following example demonstrates the combination of header arguments
required to generate the correctly named output.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: R-graphics.org --]
[-- Type: text/x-org, Size: 243 bytes --]

#+name: input
| 1 | 2 |
| 2 | 4 |
| 3 | 9 |

#+NAME: pvals_waw
#+headers: :var input=input
#+BEGIN_SRC R :results graphics :file output.pdf
plot(input)
#+END_SRC

after evaluating the code block I get

#+RESULTS: pvals_waw
[[file:output.pdf]]

[-- Attachment #3: Type: text/plain, Size: 192 bytes --]


This should be documented on Worg, but there is no doubt that there is
still work to be done on language-specific header argument
documentation.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

  reply	other threads:[~2013-05-22 16:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 12:23 R plots always exported to Rplots.pdf Greg Slodkowicz
2013-05-22 13:18 ` Eric Schulte [this message]
2013-05-22 13:38 ` Jay Kerns
2013-05-22 14:21   ` Greg Slodkowicz

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=87zjvnqazk.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=gregs@ebi.ac.uk \
    /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).