Re: [Rd] Large discrepancies in the same object being saved to .RData

From: Terry Therneau <therneau_at_mayo.edu>
Date: Mon, 12 Jul 2010 08:44:21 -0500

 I only wish to add a request for further documentation of hidden environments, their consequences, and how to turn them off. Perhaps a page in the Extending R guide, and a suggestion for book authors.

  I was bitten by this with the coxph frailty functions. They are called during the model frame creation and create a matrix object with various small attached functions as attributes. In creating the 'x' columns they have to deal with factors and can create a huge transient temporary matrix while doing so; something that will never be needed again. A user was exceeding disk quotas when he saved a model fit.

  As someone with years of experience with functional languages (which S once was), I wasn't used to the idea that one would have to take explicit --- and mysterious --- steps to make local variables go away. This discussion has revealed that the hidden rules causing local variables to be kept are more complex than I thought. Perhaps a "don't save environments" option to save could be added to help mere mortals get rid of all this stuff in the attic (with its secret staircase)?

[[Soapbox on]] Environments have proven useful for many things, and certainly aren't going away. But to quote the bard "Oh what tangled webs we weave, when first we practice to decieve."

Terry Therneau



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 12 Jul 2010 - 13:47:16 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 12 Jul 2010 - 19:00:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive