On 11/11/2010 11:27 PM, Terry Therneau wrote:
> I'm still puzzled by recover though.
It looks like a buglet. You get to the right frame (try ls()) but the
"called from" message is off by four frames.
E.g.
Selection: 1
Called from: model.frame(formula = "zed ~ 1+age+sex+year", data = mydata)
Br
Kevin,
The answer came from Gabor -- the model.frame function has a
non-standard evaluation, in that it uses the enviromnent attached to the
formula as the "enclosure" for looking up variable names.
This is clearly documented and I somehow missed it when reading the
page. So "reading deficit"
On Thu, Nov 11, 2010 at 5:27 PM, Terry Therneau wrote:
> Gabor wrote:
> At the above statement you have lost the environment of your formula.
>
>> m$formula <- tform
>
> Replace this with:
>
> m$formula <- as.formula(tform, environment(formula))
>
> --
> No, I have not "lo
Hi Terry,
This may not really be a complete answer, but there seems to be a
difference in eval'ing an expression compared to eval'ing a call (even
though both are documented in the help page for eval as working just fine).
If you insert the line
print(eval(expression(zed), parent.frame())
Gabor wrote:
At the above statement you have lost the environment of your formula.
>m$formula <- tform
Replace this with:
m$formula <- as.formula(tform, environment(formula))
--
No, I have not "lost" an environment. I manufactured a formula which
lacked something ne
On Thu, Nov 11, 2010 at 3:08 PM, Terry Therneau wrote:
> The survexp function can fail when called from another function. The "why" of
> this has me baffled, however.
>
> Here is a simple test case, using a very stripped down version of survexp:
>
> survexp.test <- function(formula, data,
>
The survexp function can fail when called from another function. The "why" of
this has me baffled, however.
Here is a simple test case, using a very stripped down version of survexp:
survexp.test <- function(formula, data,
weights, subset, na.action, rmap,
times, cohort=TRUE,