[R] change default measurement unit to millimetre

Patrick Connolly p_connolly at slingshot.co.nz
Thu Aug 20 22:01:20 CEST 2009


On Thu, 20-Aug-2009 at 10:25PM +1000, Jim Lemon wrote:

> e-letter wrote:
>> Readers,
>>
>> How do I configure R so that all units of measurement are in
>> millimetres? For example if I want to set the width of a graph, I want
>> to write:
>> width=100
>> and R interprets this value as millimetres.
>>
>>   
> Hi e-letter,
> If you just want a quick hack:
>
> mm2in<-function(mm) return(mm/25.4)
>
> then
>
> width=mm2in(100)

As a dedicated lazy typist, I've discovered that this is less typing:

width=100/25.4



>
> Jim
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___    Patrick Connolly   
 {~._.~}                   Great minds discuss ideas    
 _( Y )_  	         Average minds discuss events 
(:_~*~_:)                  Small minds discuss people  
 (_)-(_)  	                      ..... Eleanor Roosevelt
	  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.




More information about the R-help mailing list