Skip to content
Prev 337123 / 398528 Next

expressions (nesting, substitution, 2-stage evaluation)

1. I don't think this is the right way to go about this. I would think
about making pieces of your title arguments and assembling them in
your call.

... But be that as it may...

2. The problem is that in your loop, ii is already an expression -- a
language object. Pasting to it is meaningless.  So you need to deparse
it first to a character string and paste to that. Then parse the
result:

vectorA <- c( quote(TNF-*alpha), quote(IFN-*gamma) )

for(ii in vectorA)  {
   plot(0:1,0:1)
  ex <- paste("abcd*~~",deparse(ii),sep="")
   title(main = (parse(text=ex)))
}


3. There may well be more elegant ways to do this. But discovering
them exceeds my capabilities.


Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch
On Thu, Feb 27, 2014 at 5:37 PM, Daryl Morris <darylm at uw.edu> wrote: