[R] main= bquote(paste("Results for ", beta, "3", ==.(b1)))) doesn't work.

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sun Jul 30 23:40:47 CEST 2006


"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



More information about the R-help mailing list