Open gavinsimpson opened 9 years ago
Yes, it is a scoping issue. The error comes from this call:
> traceback()
...
3: gam(x[, j] ~ s(pcurve$lambda, m = dfj), family = poisson())
...
The gam
function does not see pcurve
data with lambda
at all, but sees the pcurve
function.
Following is a dirty fix that passes the lambda
in data
to gam
:
gam(x[,j] ~ s(lambda, m=dfj), data=data.frame(lambda=pcurve$lambda))
Thanks @jarioksa. This is mainly a reminder for me to fix this once I've gutted pcurve to be more vegan-like than monolithic-like. Current behaviour (but fixed) will be preserved in function oldpcurve()
.
Running
prcurve()
withfit.meth = "poisson"
orfit.meth = "binomial"
results in an error due it not findinglambda
:This is likely a scoping issue.