emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [PATCH] Re: [BUG] [babel] R graphics header arg :units


From: Andreas Leha
Subject: Re: [O] [PATCH] Re: [BUG] [babel] R graphics header arg :units
Date: Tue, 19 Jun 2012 09:05:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

address@hidden (Thomas S. Dye) writes:

> Andreas Leha <address@hidden> writes:
>
>> Hi all,
>>
>> I am having troubles in using the header argument :units which is
>> implemented for R source blocks.  Example:
>>
>> #+begin_src R :results graphics :file wideplot.png :width 14 :height 7 
>> :units "cm"
>>   plot(1:10, 1:10)
>> #+end_src
>>
>>
>> This expands to
>>
>> : png(filename="wideplot.png",height=7,units=cm,width=14)
>> : plot(1:10, 1:10)
>> : dev.off()
>>
>> and leads -- when evaluated -- to the error
>>
>> : Fehler in match.arg(units, c("in", "px", "cm", "mm")) : 
>> :   'arg' must be NULL or a character vector
>>
>> I guess this is a bug, correct?  Otherwise, how do I correctly use
>> this header argument?
>>
>> Regards,
>> Andreas
>>
>>
>>
>
> Aloha all,
>
> The attached patch handles quoted string values for R device header
> arguments.  With the patch the following works as expected:
>
> #+header: :width 100 :height 100 :units "mm" :res 120
> #+BEGIN_SRC R :results graphics :file "test.png"
> x <- c(1,2,3,4,5)
> y <- x
> plot(x,y)
> #+END_SRC
>
> All the best,
> Tom


Hi Tom,

very nice.  With your patch I can confirm the :units argument accepts
quoted strings!

Thanks a lot,
Andreas




reply via email to

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