jgellar / pcox

Penalized Cox regression models
1 stars 0 forks source link

Problem passing modified "dots" #31

Closed jgellar closed 9 years ago

jgellar commented 9 years ago

I am implementing domain transformations for hf (historical terms), in the "transforms" branch on github. In order to do this, in hf I need to pull out the "dots" with dots <- list(...), modify the dots, and then pass those dots back into a call to p. Right now I'm executing that call as follows:

do.call(p, args=c(dots,
                    list(limits=limits, linear=linear, tv=tv,
                         basistype=basistype, sind=sind,
                         integration=integration, standardize=standardize)))

The call isn't getting set up right. The problem is with the "unnamed" elements of dots (i.e., the data). For some reason it gets entered into the new call with class "call"? Not sure why.

Anyways, could you take a look? There's probably an easy solution, but I can't figure it out.

To run an example, do the following:

  1. Check out the "transforms" branch
  2. Run pcoxStable.R, at least up to the point where dat5.1 gets generated
  3. In pcox.testing2.R, run fit5.3b This will cause an error.

EDIT: you will actually get the same error if you run fit5.1 from the stable file, so no need to go to pcoxTesting2.R.

jgellar commented 9 years ago

I found a solution on SO here: http://stackoverflow.com/questions/7028385/can-i-remove-an-element-in-dot-dot-dot-and-pass-it-on (Gavin Simpson's first solution involving defining a local function), and implemented it in 999c2f0dd9a9f6506ff93efaa0bb38561fd38ea8.

It's a nice little trick I'm glad I know about now.