On Wed, 2 Aug 2006, Robin Hankin wrote:

> Hi
> 
> I am writing a package in which a function needs a dataset (of  
> precomputed Stirling
> numbers) to work.   The .rda file resides in the data/ directory.
> 
> Toy example follows:
> 
> 
> f <- function(x){
>    data(logS1)
>    . . . do stuff . . .
>    return(answer)
> }
> 
> 
> Is this a good way to do this?
> What is best practice in such situations?

This is exactly what the sysdata.rda facility is provided for: see 
`Writing R Extensions'.  (It works best for packages with namespaces, as 
then its content is by default not exported.)

-- 
Brian D. Ripley,                  [EMAIL PROTECTED]
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

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to