emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Babel/R: trouble with :units header arg


From: Christian Moe
Subject: [O] Babel/R: trouble with :units header arg
Date: Thu, 21 Apr 2011 21:38:55 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]