[Bioc-devel] data package
Sean Davis
sdavis2 at mail.nih.gov
Thu Feb 7 15:32:25 CET 2008
On Feb 7, 2008 9:20 AM, John Lande <john.lande77 at gmail.com> wrote:
> Dear Bioc,
>
> I am creating an R package for Bioconductor.
> I am supplying sample data with the package.
>
> Please tell me which is the best way to supply this data to those who will
> then use my package ?
>
> I see two alternatives:
>
> 1. Put the sample data tables (in .csv format) in the package's "data"
> subdirectory.
> In the documentation I supply with my package, put an R statement which
> imports
> those .csv files from the above "data" subdirectory.
>
> But how do I find out where (it may be different on different platforms)
> the user has installed my
> package ?
> I need this information in order to tell my data import command, from
> which directory to
> load the above sample data files.
You probably want to read up on using system.file() for the above, but
I'm not sure that is what you are looking for as a final solution.
>
> 2. Put the sample tables in a .Rdata workspace.
> In my documentation, put an R statement that loads the above .Rdata file.
You probably want to use the "data" subdirectory to store your
files/objects. Then, you can load them using the data() command. The
"Writing R Extensions Manual" has some details:
http://cran.r-project.org/doc/manuals/R-exts.html#Package-subdirectories
Hope that helps.
Sean
More information about the Bioc-devel
mailing list