[R] R-help Digest, Vol 62, Issue 24

Terry Therneau therneau at mayo.edu
Thu Apr 24 15:49:34 CEST 2008

---begin included message ----
i need to use pspline. In this pspline function coxph.wtest was used. When I
try to make some change to this function by pulling out the pspline
function, it turns out R gave me an error msg, saying coxph.wtest cannot be
found. Even if i dont change anything in pspline and just rename it and run
the function, it did not work out. Can any one help me with this? is there
anyway to get the coxph.wtest function? thank you

--- end included message

  Your question is not completely clear to me, but I will guess that you have 
"pulled out" some code from coxph and tried to run it separately.  If so, you 
are running into the name space problem: not all functions within the survival 
package are visible outside of the package.  (Those for which the authors 
assumed that "no one would call the function themselves".)  A quick solution is 
to make your own local copy
  > coxph.wtest <- survival:::coxph.wtest

It will now be visible to you.  
		Terry T.

More information about the R-help mailing list