[R] expression, strsplit, ...

2008-06-25 Thread baptiste Auguié
DeaR list, I'm a bit lost in the behavior of substitute and co. I often use fairly long axis labels in my graphs (long to write, that is). Typically, they would contain some greek letters and units with exponents, as in: xlab=expression(paste("text ", alpha, " / ", V,".", m^{-3}, ".", kg

Re: [R] expression, strsplit, ...

2008-06-25 Thread Gabor Grothendieck
Try this: plot(1, xlab = ~ alpha / V * m^-3 * kg ^-2 * l^4) On Wed, Jun 25, 2008 at 1:06 PM, baptiste Auguié <[EMAIL PROTECTED]> wrote: > DeaR list, > > I'm a bit lost in the behavior of substitute and co. > I often use fairly long axis labels in my graphs (long to write, that is). > Typically,

Re: [R] expression, strsplit, ...

2008-06-26 Thread baptiste Auguié
On 25 Jun 2008, at 19:45, Gabor Grothendieck wrote: Try this: plot(1, xlab = ~ alpha / V * m^-3 * kg ^-2 * l^4) Thanks, I would never have expected this code to work, this is a mystery to me! Actually, I thought xlab wanted an expression, but it seems to be happy with a formula. Also,

Re: [R] expression, strsplit, ...

2008-06-26 Thread Gabor Grothendieck
bquote is used like this: alpha <- 5 xlab <- bquote(.(alpha) / V * m^-3 * kg ^-2 * l^4) plot(1, xlab = xlab) On Thu, Jun 26, 2008 at 4:21 AM, baptiste Auguié <[EMAIL PROTECTED]> wrote: > > On 25 Jun 2008, at 19:45, Gabor Grothendieck wrote: > >> Try this: >> >> plot(1, xlab = ~ alpha / V * m^-3

Re: [R] expression, strsplit, ...

2008-06-26 Thread Prof Brian Ripley
On Thu, 26 Jun 2008, baptiste Auguié wrote: On 25 Jun 2008, at 19:45, Gabor Grothendieck wrote: Try this: plot(1, xlab = ~ alpha / V * m^-3 * kg ^-2 * l^4) Thanks, I would never have expected this code to work, this is a mystery to me! Actually, I thought xlab wanted an expression, but

Re: [R] expression, strsplit, ...

2008-06-26 Thread baptiste Auguié
OK, thanks to both of you for the clarifications. I guess part of my confusion came from the numerous functions and concepts involved in producing such labels: - call vs string vs formula vs expression ... - substitute, bquote, expression, "~", .(), ... I take it as a good thing once you ha

Re: [R] expression, strsplit, ...

2008-06-26 Thread Bert Gunter
EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of baptiste Auguié Sent: Thursday, June 26, 2008 5:54 AM To: R Help Subject: Re: [R] expression, strsplit, ... OK, thanks to both of you for the clarifications. I guess part of my confusion came from the numerous functions and concepts involv