[R] vcf, plink and other files in the /demo of a package
Duncan Murdoch
murdoch.duncan at gmail.com
Mon Dec 2 19:35:33 CET 2013
On 02/12/2013 11:59 AM, Federico Calboli wrote:
> Hi All,
>
> together with colleagues we are planning to submit a 2.0 version of a package we have on CRAN. Because the package deals with high throughput genomic data we though it would be nice to have some sort of guidance for the users. This should ideally mean a 'vignette', but as the time of writing nobody had time to set one up. What we have is three scripts that are heavily commented and a bunch of files (plink binary files and vcd files) that provide the 'example' data for these scripts. I was wondering whether the /demo directory would be an appropriate place where to put these scripts and the relative data.
>
> I ask because I am checking the package build and I get:
>
> checking index information ... WARNING
> Demo index entries without corresponding demo:
> [1] "/plink/MultiPhen_plink" "/simul/MultiPhen_simul" "/vcf/MultiPhen_vcf"
> See the information on INDEX files and package subdirectories in the
> chapter ‘Creating R packages’ of the ‘Writing R Extensions’ manual.
>
> despite the fact I did create a 00Index file in /demo:
>
> /demo$ cat 00Index
> /plink/MultiPhen_plink MultiPhen demo of how to use PLINK BED files
> /simul/MultiPhen_simul MultiPhen demo of how to run a simulation with MultiPhen
> /vcf/MultiPhen_vcf MultiPhen demo of how to use data in vcf format
>
> What am I missing? Given the state of the documentation (i.e. no vignette and demo scripts that rely on data that is not in .rda format) would we be better off removing this stuff altogether?
Those index entries should be filenames of the demo files. The leading
slash likely means R will interpret them as absolute paths, not relative
paths, and that won't work.
A more usual way to do it would be to give them simple names, e.g.
MultiPhen_plink (corresponding to MultiPhen_plink.R).
Since your demos refer to data files that are not embedded in the R
code, you need to put those data files somewhere. They should go into
the data directory if they are data a user can read (and then you need
to follow the restrictions on things in that directory), or into your
own directory below inst, to just be installed and available for use. In
the latter case use system.file() to refer to them from within your demo
code.
Duncan Murdoch
More information about the R-help
mailing list