Giovanni Petris <GPetris <at> uark.edu> writes:

> 
> 
> Hello!
> 
> I am trying to put two math expressions in the title of a plot.  As
> you can see below, I can place correctly one expression at a time, but
> not both. Ideally I would like to have them separated by a comma. Any
> suggestions? 
> 
> > k <- 1
> > n.eff <- c(20, 30)
> > ### this works
> > plot(0,0, main = substitute(n == k, list(k = k)))
> > ### this works
> > plot(0,0, main = substitute(N[eff] == neff, list(neff = n.eff[k])))
> > ### this doesn't work
> > plot(0,0, main = substitute(n == k * N[eff] == neff, list(k = k, neff = 
n.eff[k])))
> 

This should do it for you:

plot(0,0, main = substitute(paste(n == k*", ", N[eff] == neff), list(k = k, 
neff = n.eff[k])))

______________________________________________
R-help@r-project.org 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.

Reply via email to