jgellar / pcox

Penalized Cox regression models
1 stars 0 forks source link

coef.pcox - export issues? #34

Closed jgellar closed 9 years ago

jgellar commented 9 years ago

I've been talking with a student at Hopkins who is trying to use pcox. She was having trouble using the coef() method, and I finally discovered that the reason why was that we had not added @export to coef.pcox. We had included @export with coefficients.pcox, but for whatever reason none of coef, coef.pcox, or coefficients.pcox were working without the tag added to coef.pcox as well.

Now she is able to use coef, and it is returning the right thing (a data frame). However, she did tell me that if she types the full names coef.pcox or coefficients.pcox, the functions are not found. I don't know why this would be.

Do you have any ideas? This problem also came up in refund with coef.pfr. I fell like there is something we're missing.

jgellar commented 9 years ago

Also, note that I re-wrote coefficients.pfr in the devel branch of github, and it hasn't been fully tested yet (or really tested at all). The new version doesn't call plot.gam at all, it does everything "manually". The reason I did this was first because it was the only way to extract coefficients of 3 or more dimensions, but it also turned out to run faster, provides the ability to extract coefficients at unequally spaced coordinates.

The reason I bring this up is because, if you get a chance to look at this issue, you should probably do it on the master branch. I would expect that the problem (and solution) would be the same with both versions, but it would be easier for you to look at the more stable version.

jgellar commented 9 years ago

So I solved this, but only by manually editing the NAMESPACE file. The @export tag for our S3 methods adds S3Method(generic, class) to the NAMESPACE file, but it does not add export(method). When I added export(coefficients.pfr) and export(coef.pfr), the problem was gone.

We don't want to have to manually edit the NAMESPACE file though.