Marco Boks
2006-Jul-30 21:15 UTC
[R] main= bquote(paste("Results for ", beta, "3", ==.(b1)))) doesn't work.
Hi, I need to plot the beta as the symbol, followed by the index 3 as the title of a graph. This code works> main= bquote(paste("Results for ", beta ==.(b1)) but I also need the index 3. I tried (simplified):>plot(x,y, main= bquote(paste("Results for ", beta, "3", ==.(b1))))and a few other versions, but I can not get it to run properly. Any help would be greatly appreciated, Thanks Marco [[alternative HTML version deleted]]
Gabor Grothendieck
2006-Jul-30 21:25 UTC
[R] main= bquote(paste("Results for ", beta, "3", ==.(b1)))) doesn't work.
I assume the 3 is supposed to be a subscript. Try this: b1 <- x <- y <- 1 plot(x,y, main = bquote("Results for " ~ beta[3] ==.(b1))) On 7/30/06, Marco Boks <marco.boks at inter.nl.net> wrote:> Hi, > > I need to plot the beta as the symbol, followed by the index 3 as the title of a graph. > > This code works> main= bquote(paste("Results for ", beta ==.(b1)) > > but I also need the index 3. > I tried (simplified): > > >plot(x,y, main= bquote(paste("Results for ", beta, "3", ==.(b1)))) > > and a few other versions, but I can not get it to run properly. > > Any help would be greatly appreciated, > > Thanks > > Marco > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >
Peter Dalgaard
2006-Jul-30 21:40 UTC
[R] main= bquote(paste("Results for ", beta, "3", ==.(b1)))) doesn't work.
"Marco Boks" <marco.boks at inter.nl.net> writes:> Hi, > > I need to plot the beta as the symbol, followed by the index 3 as the title of a graph. > > This code works> main= bquote(paste("Results for ", beta ==.(b1)) > > but I also need the index 3. > I tried (simplified): > > >plot(x,y, main= bquote(paste("Results for ", beta, "3", ==.(b1)))) > > and a few other versions, but I can not get it to run properly. > > Any help would be greatly appreciated,Are you looking for plot(0,0, main= bquote(paste("Results for ", beta[3] ==.(b1)))) ? Your fundamental problem is that expressions need to be syntactically complete, so "==.(b1)" with no left hand side gets you a syntax error. However, you can supply a dummy, and plot(0,0, main= bquote(paste("Results for ", beta, 3, {} ==.(b1)))) does work (although possibly not with your desired output). -- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Stuart Leask
2006-Jul-31 07:52 UTC
[R] main= bquote(paste("Results for ", beta, "3", ==.(b1)))) doesn't work.
b1<-3 plot(1,1, main= bquote(paste("Results for ", beta==.(b1)))) seems to work. Stuart Dr Stuart J Leask DM MRCPsych MA BChir Senior Lecturer and Honorary Consultant in Clinical Psychiatry University Dept of Psychiatry, Duncan Macmillan House Porchester Road. Nottingham. NG3 6AA. http://www.nottingham.ac.uk/psychiatry/staff/s_leask.html ----- Original Message ----- From: "Marco Boks" <marco.boks at inter.nl.net> To: <r-help at stat.math.ethz.ch> Sent: Sunday, July 30, 2006 10:15 PM Subject: [R] main= bquote(paste("Results for ", beta, "3",==.(b1)))) doesn't work.> Hi, > > I need to plot the beta as the symbol, followed by the index 3 as the > title of a graph. > > This code works> main= bquote(paste("Results for ", beta ==.(b1)) > > but I also need the index 3. > I tried (simplified): > >>plot(x,y, main= bquote(paste("Results for ", beta, "3", ==.(b1)))) > > and a few other versions, but I can not get it to run properly. > > Any help would be greatly appreciated, > > Thanks > > Marco > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch 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.This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.