* R plots always exported to Rplots.pdf
@ 2013-05-22 12:23 Greg Slodkowicz
2013-05-22 13:18 ` Eric Schulte
2013-05-22 13:38 ` Jay Kerns
0 siblings, 2 replies; 4+ messages in thread
From: Greg Slodkowicz @ 2013-05-22 12:23 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 633 bytes --]
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
--
Greg Slodkowicz
PhD student, Nick Goldman group
EMBL-EBI
[-- Attachment #2: Type: text/html, Size: 976 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: R plots always exported to Rplots.pdf
2013-05-22 12:23 R plots always exported to Rplots.pdf Greg Slodkowicz
@ 2013-05-22 13:18 ` Eric Schulte
2013-05-22 13:38 ` Jay Kerns
1 sibling, 0 replies; 4+ messages in thread
From: Eric Schulte @ 2013-05-22 13:18 UTC (permalink / raw)
To: Greg Slodkowicz; +Cc: emacs-orgmode
[-- 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: R plots always exported to Rplots.pdf
2013-05-22 12:23 R plots always exported to Rplots.pdf Greg Slodkowicz
2013-05-22 13:18 ` Eric Schulte
@ 2013-05-22 13:38 ` Jay Kerns
2013-05-22 14:21 ` Greg Slodkowicz
1 sibling, 1 reply; 4+ messages in thread
From: Jay Kerns @ 2013-05-22 13:38 UTC (permalink / raw)
To: Greg Slodkowicz; +Cc: emacs-orgmode
Hi Greg,
On Wed, May 22, 2013 at 8:23 AM, Greg Slodkowicz <gregs@ebi.ac.uk> wrote:
[snip]
> 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
>
Have you tried (something like) this?
#+BEGIN_SRC R :exports results :results graphics :file fig1.png
I hope this helps,
--
Jay
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: R plots always exported to Rplots.pdf
2013-05-22 13:38 ` Jay Kerns
@ 2013-05-22 14:21 ` Greg Slodkowicz
0 siblings, 0 replies; 4+ messages in thread
From: Greg Slodkowicz @ 2013-05-22 14:21 UTC (permalink / raw)
To: Jay Kerns; +Cc: Greg Slodkowicz, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 653 bytes --]
That solves it, many thanks!
- Greg
On Wed, May 22, 2013 at 2:38 PM, Jay Kerns <gjkernsysu@gmail.com> wrote:
> Hi Greg,
>
> On Wed, May 22, 2013 at 8:23 AM, Greg Slodkowicz <gregs@ebi.ac.uk> wrote:
>
> [snip]
>
> > 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
> >
>
> Have you tried (something like) this?
>
> #+BEGIN_SRC R :exports results :results graphics :file fig1.png
>
> I hope this helps,
>
>
> --
> Jay
>
--
Greg Slodkowicz
PhD student, Nick Goldman group
EMBL-EBI
[-- Attachment #2: Type: text/html, Size: 1288 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-05-22 16:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-22 12:23 R plots always exported to Rplots.pdf Greg Slodkowicz
2013-05-22 13:18 ` Eric Schulte
2013-05-22 13:38 ` Jay Kerns
2013-05-22 14:21 ` Greg Slodkowicz
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).