Re: [R] quick square root axes

2009-05-06 Thread Jim Lemon
Markus Loecher wrote: Dear R users, while I enjoy the built-in log argument to the plot() function, I wished it would be as easy to create more general custom transformed axes such as sqrt(), logit, etc... for example, instead of plot(x=exp(rnorm(10)), y=(1:10)^4, log = xy), sth. along the

Re: [R] quick square root axes

2009-05-06 Thread Carl Witthoft
Here's a QD bit of code I wrote up a while back. Dunno if it'll be of any use in setting up your tickmarks. # x, n same meaning as in pretty() # update: check for x neg or zero # ... is for other args to pretty() prettylog- function(x,n=10,base=10,...) { x-unlist(x) if

[R] quick square root axes

2009-05-05 Thread Markus Loecher
Dear R users, while I enjoy the built-in log argument to the plot() function, I wished it would be as easy to create more general custom transformed axes such as sqrt(), logit, etc... for example, instead of plot(x=exp(rnorm(10)), y=(1:10)^4, log = xy), sth. along the lines of

Re: [R] quick square root axes

2009-05-05 Thread Duncan Murdoch
On 5/5/2009 1:05 PM, Markus Loecher wrote: Dear R users, while I enjoy the built-in log argument to the plot() function, I wished it would be as easy to create more general custom transformed axes such as sqrt(), logit, etc... for example, instead of plot(x=exp(rnorm(10)), y=(1:10)^4, log =

Re: [R] quick square root axes

2009-05-05 Thread baptiste auguie
On 5 May 2009, at 19:28, Duncan Murdoch wrote: On 5/5/2009 1:05 PM, Markus Loecher wrote: Dear R users, while I enjoy the built-in log argument to the plot() function, I wished it would be as easy to create more general custom transformed axes such as sqrt(), logit, etc... for example,

Re: [R] quick square root axes

2009-05-05 Thread hadley wickham
If you do write your own, the hardest part will be picking the nice tick marks.  They should be approximately evenly spaced, but at nice round values of the original variable:  that's hard to do in general.  R has the pretty() function for the linear scale, and doesn't do too badly on log