Skip to content
Prev 99238 / 398500 Next

terms.inner

On Tue, 5 Sep 2006, Terry Therneau wrote:

            
AFAIK it wasn't removed, it just hasn't ever been implemented. Probably 
no-one in the early years of R tried to port any code that used it -- 
there were a number of functions added back then just because the survival 
package used them, such as subscripting on terms objects.
Perhaps not the best soapbox example. There are at least two gam 
implementations, but they are both in add-on packages. Neither of them 
hides its plot.gam in a namespace, but you do need to install and load the 
package.  You presumably want Trevor Hastie's one, which is in the "gam" 
package, rather than Simon Woods' one in the "mgcv" package.

BTW, termplot() does many of the same things as Hastie's plot.gam(). It is 
also not hidden. If I understand correctly what terms.inner does, 
termplot() uses two functions:
     pf <- envir
     carrier <- function(term) {
         if (length(term) > 1)
             carrier(term[[2]])
         else eval(term, data, enclos = pf)
     }
     carrier.name <- function(term) {
         if (length(term) > 1)
             carrier.name(term[[2]])
         else as.character(term)
     }
to do the job.


 	-thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle