Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-21 Thread Bert Gunter
Yet again:Thank you Peter and Duncan. I appreciate your comments and insights. I agree wholeheartedly with Peter's comments below about understanding what a parsed expression is in R. In R -- and in functional programming in general, I believe -- computing on the language is extremely handy, even

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-21 Thread William Dunlap
ay, May 20, 2012 4:40 PM > To: Robert Baer > Cc: William Dunlap; r-help > Subject: Re: [R] Names of Greek letters stored as character strings;plotmath. > > On 21/05/12 10:53, Robert Baer wrote: > > > > > > > > > > This discussion has been exceedingly

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-21 Thread peter dalgaard
On May 21, 2012, at 05:25 , Duncan Murdoch wrote: > On 12-05-20 10:28 PM, Bert Gunter wrote: >> Well, that's not very comforting, Duncan. It's like saying that you >> have to read the engineering specs to drive the car successfully. > > I think Robert's message that I responded to was asking for

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-20 Thread Duncan Murdoch
shaddup" would therefore not be out of line. Best, Bert On Sun, May 20, 2012 at 5:00 PM, Duncan Murdoch wrote: On 12-05-20 6:53 PM, Robert Baer wrote: -Original Message- From: William Dunlap Sent: Saturday, May 19, 2012 11:07 AM To: Rolf Turner Cc: r-help Subject: Re: [R] Name

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-20 Thread Joshua Wiley
y)) : >>> :1:7: unexpected symbol >>> 1: Waist Size >>>^ >>> >>> Now you might say that serves me right for using weird variable names, >>> but some of us use R as a back end to a GUI system (one not designed >>> arou

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-20 Thread Bert Gunter
-20 6:53 PM, Robert Baer wrote: >> >> -Original Message- >> From: William Dunlap >> Sent: Saturday, May 19, 2012 11:07 AM >> To: Rolf Turner >> Cc: r-help >> Subject: Re: [R] Names of Greek letters stored as character >> strings;plotmath. >>

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-20 Thread Duncan Murdoch
On 12-05-20 6:53 PM, Robert Baer wrote: -Original Message- From: William Dunlap Sent: Saturday, May 19, 2012 11:07 AM To: Rolf Turner Cc: r-help Subject: Re: [R] Names of Greek letters stored as character strings;plotmath. parse(text=paste(...)) works in simple cases but not in others

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-20 Thread Rolf Turner
On 21/05/12 10:53, Robert Baer wrote: This discussion has been exceedingly helpful, sort of. Every time I try to do a task involving this I read the documentation for bquote(), expression(), plotmath(), etc., over and over, and I still fail to get the big picture of how R parses things u

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-20 Thread Robert Baer
-Original Message- From: William Dunlap Sent: Saturday, May 19, 2012 11:07 AM To: Rolf Turner Cc: r-help Subject: Re: [R] Names of Greek letters stored as character strings;plotmath. parse(text=paste(...)) works in simple cases but not in others. The fortune about it is there because

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-19 Thread Rolf Turner
Many thanks to Baptiste Auguie (off list), Bill Dunlap, Bert Gunter, Gabor Grothendieck, and Paul Johnson for their interesting and informative responses to my post. The main item to note is that I was piling on unnecessary baggage by using plot(1:10,xlab= eval(expression(parse(text=xNm))

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-19 Thread William Dunlap
gt; > plot(0, main=bquote(.(x)^.(as.vector(power, "symbol"))/.(y))) > > I personally think "as.symbol" is more likely to be understood by > students, I may stick to that. So I think the most succinct, best > approach is > > > plot(0, main=bquote(.(x

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-19 Thread Gabor Grothendieck
On Sat, May 19, 2012 at 2:16 PM, Paul Johnson wrote: > On Sat, May 19, 2012 at 11:07 AM, William Dunlap wrote: >> parse(text=paste(...)) works in simple cases but not in others.  The >> fortune about it is there because it is tempting to use but if you bury it >> in a general purpose function it

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-19 Thread Paul Johnson
is: power <- as.symbol("gamma") ; x <- "Waist Size (cm)" ; y <- "Weight (kg)" plot(0, main=bquote(.(x)^.(power)/.(y))) Speaking of commands that have identical results and exist separately for no apparently good reason: library(help=rockchalk) help(packag

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-19 Thread William Dunlap
UI system (one not designed around R) and don't want to inflict on users R's rules for names when we do not have to. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-19 Thread Bert Gunter
..and a final addendum: xnm <- quote(gamma) ## makes xnm the name gamma not the string "gamma" plot(0,xlab = bquote( .(xnm)) -- Bert On Sat, May 19, 2012 at 7:23 AM, Bert Gunter wrote: > ... and here is another incantation that may be  informative. > > xnm<- as.name("gamma')  ## This does the

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-19 Thread Bert Gunter
... and here is another incantation that may be informative. xnm<- as.name("gamma') ## This does the parsing plot(0, xlab =bquote(.(xnm)) The initial puzzle is that if you just set xnm <- "gamma" bquote will insert the string "gamma" rather than the symbol. After all, that's what plotmath sees

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-19 Thread Gabor Grothendieck
On Sat, May 19, 2012 at 1:18 AM, Rolf Turner wrote: > > I had such good luck with my previous question to r-help, (a few minutes > ago) that I thought I would try again with the following query: > >> Suppose I have >> >>    xNm <- "gamma" >> >> I would like to be able to do >> >>    plot(1:10,xlab

[R] Names of Greek letters stored as character strings; plotmath.

2012-05-18 Thread Rolf Turner
I had such good luck with my previous question to r-help, (a few minutes ago) that I thought I would try again with the following query: Suppose I have xNm <- "gamma" I would like to be able to do plot(1:10,xlab = ) and get the x axis label to be the Greek letter gamma (rather than