On Jun 15, 2011, at 16:22 , Prof Brian Ripley wrote:

> 
> So your example creates an object 'x' in the package or name space. Which is 
> perfectly legal, but maybe not intentional.  For example, R's base package 
> does
> ...

Yes. Nothing illegal about it, but might be worth noticing that if LazyLoading 
is used, then the object will be computed only once, while building the 
package. 

So "today <- date()" or "calibrate <- system.time(for(i in 1:1e6)...))" or is a 
bad idea unless you really want the value at build time on the build computer. 

Having results depending on whether or not LazyLoading is being used is 
probably not a good idea in any case. To have things happen on load, use 
.onLoad and relatives. 

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd....@cbs.dk  Priv: pda...@gmail.com

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to