[O] R plots always exported to Rplots.pdf

2013-05-22 Thread Greg Slodkowicz
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


Re: [O] R plots always exported to Rplots.pdf

2013-05-22 Thread Jay Kerns
Hi Greg,

On Wed, May 22, 2013 at 8:23 AM, Greg Slodkowicz gr...@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



Re: [O] R plots always exported to Rplots.pdf

2013-05-22 Thread Greg Slodkowicz
That solves it, many thanks!

- Greg


On Wed, May 22, 2013 at 2:38 PM, Jay Kerns gjkerns...@gmail.com wrote:

 Hi Greg,

 On Wed, May 22, 2013 at 8:23 AM, Greg Slodkowicz gr...@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


Re: [O] R plots always exported to Rplots.pdf

2013-05-22 Thread Eric Schulte
Greg Slodkowicz gr...@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.

#+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]]

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