I am trying to compare and contrast the smoothing in the {mgcv} version of gam vs. the {gam} version of gam but I get a strange side effects when I try to alternate calls to these routines, even though I detach and unload namespaces.
Specifically when I start up R the following code runs successfully until the last line i.e. plot(g4,se=TRUE) when I get "Error in dim(data) <- dim : attempt to set an attribute on NULL". On subsequent attempts to plot any gam::gam object I get the same result. The only way I can get gam:gam working again is to close down R and restart it. x=runif(1:20) y=runif(1:20) library(gam) g1= gam::gam( y ~ s(x,5) ) plot(g1,se=TRUE) detach(package:gam,unload=TRUE) detach(package:splines,unload=TRUE) library(gam) g2= gam::gam( y ~ s(x,5) ) plot(g2,se=TRUE) detach(package:gam,unload=TRUE) detach(package:splines,unload=TRUE) library(mgcv) g3 = mgcv::gam( y ~ s(x) ) plot(g3) detach(package:mgcv,unload=TRUE) library(gam) g4= gam::gam( y ~ s(x,5) ) plot(g4,se=TRUE) Julian Shaw Notice: This e-mail message is intended only for the named recipient(s) above. It may contain confidential information that is proprietary or privileged. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. Please immediately notify the sender by replying to this e-mail and delete the message and any attachment(s) from your system. Permal archives and reviews outgoing and incoming e-mail. It may be produced at the request of regulators or in connection with civil litigation. Permal accepts no liability for any errors or omissions arising as a result of transmission. Any proposals, offers or other potential terms described or referred to in this message are "subject to contract" and shall not be binding on any member of the Permal Group, or any affiliate thereof, unless and until documented in a written agreement executed by all necessary parties by their duly a! uthorized representative(s). Past performance is not indicative of future results. This material is not an offer or a solicitation to subscribe for any Permal fund. Permal Investment Management Services Limited is authorized and regulated by the Financial Services Authority in the UK and is regulated by the Dubai Financial Services Authority. Permal (Singapore) Pte. Limited, Company Registration Number 200711607C, is regulated by the Monetary Authority of Singapore. Permal (Japan) K.K., Registration Number: Director General of Kanto Local Finance Bureau ("KLFB") (FlEA) No. 2335, is authorized by the KLFB in Japan as a non-discretionary investment adviser. [[alternative HTML version deleted]] ______________________________________________ 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.