[R] place 4 ini files

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Aug 16 10:47:39 CEST 2004

Please do read what "writing R extensions" says about the data directory.
This is not a correct use of that directory, and may well fail in the next 

I suggest you install them in an ini directory, by putting them in 
inst/ini in the package sources.

On Mon, 16 Aug 2004 Thomas.Bock at ptb.de wrote:

> I collect some lab specific functions for a package.
> Some of this functions need initial data 
> (ini files written in R-code). My question is:
> Where is the place in the package structure for such files; 
> how to load the files?
> I think something like:
> source(paste(R.home(),"/library/__pkg__/data/__.ini.R", sep=""))

That makes assumptions about where a package is installed.  Use 
system.file(), e.g.

source(system.file("ini", "foo_ini.R", package="__pkg__"))

> looks a bit clumsy.
> I haven't find something about this 
> in the "writing R extensions".

See the discussion of `inst'.

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

More information about the R-help mailing list