Brian R makes good points. I made a mistake in the prior post, it should have said new.env(parent=globalenv())
for pspline. You want the saved function to pay attention to the search() path. This is what is actually in the code, I was guilty of mistyping. If the print function uses a not-exported function from the enclosing package then we need to be more careful. This is the case for rpart. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.