[R-pkg-devel] Data-generating scripts in R packages

Kevin Coombes kevin.r.coombes at gmail.com
Wed Mar 23 15:53:00 CET 2016


Hi,

I'm going to start by summarizing the suggestions (for where to put the 
script) that have been presented so far:

[1] in the /demo directory
[2] in /inst/SOMETHING, where Dirk lists four possible values for SOMETHING
[3] in /R , but hidden using .Rbuildignore
[4] in the Example section of a man page, protected by \dontrun{...}
[5] the same as [4], but after encapsulating the script in a function 
that could be exported.

Of these, I think I like [5] the best (and so will probably do things 
that way), followed by [1].

And I can't resist following up on to Dirk's (fortune-eligible?) comment 
that "there is a reasonable discussion in Writing R Extensions, but as 
always, you have to find it first".  Before posting, I read section 
1.1.6 (Data in packages) of the "fine manual", and couldn't find a clear 
recommendation for my situation. Given the range of responses, it seems 
that I wasn't alone....

Thanks to all,
   Kevin

On 3/22/2016 5:08 PM, Dirk Eddelbuettel wrote:
> Kevin,
>
> The inst/ directory gives a good handle to pass arbitrary directory layouts
> of your choosing through.  You just need to avoid inst/data as it would clash
> with an existing data/ directory.
>
> I think I have seen
>
>      inst/rawData
>      inst/extData                # as in 'external data'
>
> and of course
>
>      inst/scripts
>
> or
>
>      inst/tools
>
> Note that there is a reasonable discussion in Writing R Extensions, but as
> always, you have to find it first.
>
> Dirk
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the R-package-devel mailing list