From stephen.ellison at lgcgroup.com  Tue Jun 14 16:24:31 2011
From: stephen.ellison at lgcgroup.com (Stephen Ellison)
Date: Tue, 14 Jun 2011 15:24:31 +0100
Subject: [Rd] Loose code in R package files
In-Reply-To: <BANLkTinZSLr2uJXr63hA0ZRCkWstp5-wzA@mail.gmail.com>
References: <BANLkTi=+=sr5Xa=_L9cFSj_fP0XiHgohsA@mail.gmail.com>
	<0D1AAABC-17B9-43A1-879D-3DA1BE7F4B51@r-project.org>
	<BANLkTinZSLr2uJXr63hA0ZRCkWstp5-wzA@mail.gmail.com>
Message-ID: <98B156BB22D11342A931E823798D434852D599D392@GOLD.corp.lgc-group.com>

I'm sure i've seen the answer to this, but can't find it:

If there is executable code in an R package .R file that does not return a function (that is, something like x <- rnorm(5), outside any function body ), what will actually happens at build and load time?

And (more importantly, so I can point a colleague to documented guidance on the matter) is there somewhere in R's docs that says why this is not likely to be a good idea and suggests the sort of things it is sensible - or not sensible - to include in .R files? 


S Ellison
*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



[Rd] Loose code in R package files
Stephen Ellison