emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Babel/R: trouble with :units header arg
@ 2011-04-21 19:38 Christian Moe
  0 siblings, 0 replies; only message in thread
From: Christian Moe @ 2011-04-21 19:38 UTC (permalink / raw)
  To: Org Mode

Hi,

Some Babel/R plots that worked a couple of months ago gave an error 
message on the :units header arg when I tried to run them again now. 
There could be many reasons (including a computer upgrade in the 
meantime), but in case it's an Org thing, a minimal example follows 
below (parabola plot for 8x8cm paper output). I'd appreciate any tips.


#+begin_src R  :results graphics :file test.png :width 8 :height 8 
:res 200 :units "cm"
   x <- -10:10
   y <- x^2
   plot(x, y, type="l", col="red", lty=1)
#+end_src

Documentation indicates this should work, but I get:

  Error in match.arg(units, c("in", "px", "cm", "mm")) :
    'arg' must be NULL or a character vector
  Calls: <Anonymous> -> <Anonymous> -> png -> match.arg
  Execution halted

Same if I use single quotes or no quotes around "cm".

Replacing ~:units "cm"~ with ~:R-dev-args units="cm"~ works:

#+begin_src R  :results graphics :file test.png :width 8 :height 8 
:res 200 :R-dev-args units="cm"
   x <- -10:10
   y <- x^2
   plot(x, y, type="l", col="red", lty=1)
#+end_src

#+results:
[[file:test.png]]


Yours,
Christian

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-21 19:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-21 19:38 Babel/R: trouble with :units header arg Christian Moe

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).