Henrik Bengtsson
2006-Mar-28 15:18 UTC
[Rd] How to set options() when a package without a name space is loaded?
Hi, how do I set options() when loading a package *without* a name space? Is it possible? I though this one was a common question, but I could not find it in the FAQ, in the help nor in the r-help/r-devel archives. Section 1.6.3 on "Load hooks" in "Writing R Extensions" says that this should be done using the .onLoad hook, but that does only apply to packages name spaces, cf. ?.onLoad Thanks Henrik
Henrik Bengtsson
2006-Mar-28 15:39 UTC
[Rd] How to set options() when a package without a name space is loaded?
Don't worry. Sorry for that, I should of course know that it is in .First.lib() as documented Section 1.1.4 on "Package subdirectories" in "Writing R Extensions"; "A common use is to call library.dynam() inside .First.lib() to load compiled code: another use is to call those functions with side effects". The reason why it "didn't work" was that I mispelled the option in .First.lib(). It's time for me to go home now ;) Henrik On 3/28/06, Henrik Bengtsson <hb at maths.lth.se> wrote:> Hi, > > how do I set options() when loading a package *without* a name space? > Is it possible? > > I though this one was a common question, but I could not find it in > the FAQ, in the help nor in the r-help/r-devel archives. Section > 1.6.3 on "Load hooks" in "Writing R Extensions" says that this should > be done using the .onLoad hook, but that does only apply to packages > name spaces, cf. ?.onLoad > > Thanks > > Henrik >
Duncan Murdoch
2006-Mar-28 15:59 UTC
[Rd] How to set options() when a package without a name space is loaded?
On 3/28/2006 10:18 AM, Henrik Bengtsson wrote:> Hi, > > how do I set options() when loading a package *without* a name space? > Is it possible?Use .First.lib(). It is mentioned in the R-exts section you looked in below, but its purpose is not. Duncan Murdoch> > I though this one was a common question, but I could not find it in > the FAQ, in the help nor in the r-help/r-devel archives. Section > 1.6.3 on "Load hooks" in "Writing R Extensions" says that this should > be done using the .onLoad hook, but that does only apply to packages > name spaces, cf. ?.onLoad > > Thanks > > Henrik > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Prof Brian Ripley
2006-Mar-28 16:04 UTC
[Rd] How to set options() when a package without a name space is loaded?
BTW, sections in .texi manuals do not have numbers, so please use the node name. You can use .First.lib. On Tue, 28 Mar 2006, Henrik Bengtsson wrote:> Hi, > > how do I set options() when loading a package *without* a name space? > Is it possible? > > I though this one was a common question, but I could not find it in > the FAQ, in the help nor in the r-help/r-devel archives. Section > 1.6.3 on "Load hooks" in "Writing R Extensions" says that this should > be done using the .onLoad hook, but that does only apply to packages > name spaces, cf. ?.onLoad > > Thanks > > Henrik > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Possibly Parallel Threads
- Best way for rgl's .onLoad to fail?
- New simpleExit() condition (Was: Re: Can example() code stop the example without generating an error?)
- Clash between 'Cairo' and 'EBImage' packages on Windows
- on.exit called on loading ?
- Documentation on how to put classes and methods in packages with namespace?