Skip to content
Prev 33638 / 398503 Next

combining mathematical notation and value substitution

On Sun, 22 Jun 2003, Faheem Mitha wrote:
R is trying to *evaluate*
  "Monotonic Multigamma run ("* n==len etc
which doesn't work.  Remember, is.call(), like any normal function, will
be passed the *value* of its arguments.

You could try
  is.call(quote("Monotonic Multigamma run("*n==len))
which is TRUE.
That's because expression() returns an expression.
Well, we can find out. It must be either * or ==, but it isn't immediately
obvious which one ends up at the top level
==t1*").")
[1] "call"
[1] 3
==
"Monotonic Multigamma Run (" * n == len * ", " * theta
t1 * ")."
[1] "call"
[1] "call"
==
*

So it is a call to ==, with two arguments, each itself a call.  The first
arguemetn is also a call to == and the second is a call to *. And so on in
a tree structure.
I don't know about further reading.  I think this is probably easier to
learn when you have a specific problem to solve.  I learned mostly by
porting the survival package.


	-thomas