Skip to content

How to call a function defined within another function

5 messages · Sébastien Bihorel, Uwe Ligges, Gabor Grothendieck

#
On 19.10.2011 22:08, S?bastien Bihorel wrote:
You cannot, since it is only defined in the environment of the function 
step.gam while that is active. The gam license is "GPL-2", so go ahead.

Best,
Uwe Ligges
#
On Wed, Oct 19, 2011 at 4:08 PM, S?bastien Bihorel <pomchip at free.fr> wrote:
As has already pointed out it can't really be done but if you want a
hack then this will do it.  It does depend on the specific position of
scope.char within step.gam,
function (formula)
{
    formula = update(formula, ~-1 + .)
    tt <- terms(formula)
    tl <- attr(tt, "term.labels")
    if (attr(tt, "intercept"))
        c("1", tl)
    else tl
}