Jeff,
I absolutely agree it is a bad idea to rely on side effects.
I did figure out one way to skin this cat. It relies on an the following
from line 909 of src/main/main.c,
R_LoadProfile(R_OpenSiteFile(), baseEnv);
R_LockBinding(install(.Library.site), R_BaseEnv);
On 22/04/2014, 8:59 PM, Benjamin Tyner wrote:
Greetings,
Is there any way to programmatically detect whether a piece of code is
being run within the initial (Startup) sourcing of the site profile?
For example, say I have a site profile, /path/to/Rprofile.site. Is
there any function my_func
Thanks Duncan! Yes, I considered taking advantage of .First, but was
concerned that the .First defined by the site profile could be masked by a
possible .First defined by the user profile (I neglected to mention that
--no-init-profile [sic] in the example I gave was a
Regardless of whether this is possible, it seems like a bad idea (side effects
in a functional programming environment). If you want to do something special
in startup then write a different function that does that stuff and then call
the desired functions explicitly when you want them to be
Greetings,
Is there any way to programmatically detect whether a piece of code is
being run within the initial (Startup) sourcing of the site profile?
For example, say I have a site profile, /path/to/Rprofile.site. Is
there any function my_func which would return different values for
these two
5 matches
Mail list logo