[R] R package: Where to put code to Run Once Only?
Rolf Turner
r.turner at auckland.ac.nz
Tue Apr 7 05:57:28 CEST 2009
On 7/04/2009, at 3:34 PM, Ken-JP wrote:
<snip>
> Using NAMESPACE, I was able to hide my globals behind a
> "." (eg .myGlobal
> <<- 72) and use exportPattern("^[^\\.]*") to prevent users from
> seeing my
> globals, yet I was able to access their values inside my package.
<snip>
WHY do you want to ``prevent users from seeing [your] globals''?
The whole point of R (well, maybe not the whole point, but a major
point) is to be adaptable. If something doesn't work the way a user
wants, then the user can change things. When the inner workings
are hidden so deeply that the user can't see what to change, this
becomes effectively impossible, and the user might as well go and
use SAS.
I exaggerate but slightly.
Nevertheless, this syndrome of hiding things and making them
effectively
inaccessible --- which seems to have become an obsession with some
of the
R community, particularly many of the senior members --- bugs the
living
Drambuie out of me.
cheers,
Rolf Turner
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
More information about the R-help
mailing list