From ripley at stats.ox.ac.uk  Mon Jun  9 13:56:19 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon, 9 Jun 2008 12:56:19 +0100 (BST)
Subject: [Rd] Questions about building R extensions from C,
 data/ and man/, sbml file
In-Reply-To: <d3a410c80806090441u2c98f65ct697819c582522c30@mail.gmail.com>
References: <d3a410c80806090441u2c98f65ct697819c582522c30@mail.gmail.com>
Message-ID: <alpine.LFD.1.10.0806091249150.4265@gannet.stats.ox.ac.uk>

Use system.file().  But please don't put your files in the data directory: 
as the manual says.

   The data subdirectory is for additional data files the package makes
   available for loading using data().

So if you put your data files in inst/sbml, your example becomes

abc(fname = system.file(package="mypackage", "sbml", "xxx.sbml"))

since this will be mypackage/sbml/xxx.sbml when installed.

There are several examples on CRAN, e.g. rgdal.


On Mon, 9 Jun 2008, Hang PHAN wrote:

> Hi,
>
> I am building the package in R using
>
>> R CMD build -force ./mypackage
>
> and check it using
>
>> R CMD check ./mypackage
>
> However I have a problem when running the examples in the manual files. The
> problem is that I used a specifice type of file that is not table, thus I
> guess data() can't be use to indicate the use of that particular file in the
> directory data/. Do you have any idea how I can pass the name of this data
> file as a string into the arguments of my function
>
> e.g. in abc.Rd
> \Examples{
> ss<- abc(fname = "xxx.sbml")
> }
> where xxx.sbml is a file in the data/ directory.
>
> Again, thanks very much and looking forwards to your reply.
>
> Phan Hang
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
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



[Rd] Questions about building R extensions from C, data/ and man/, sbml file
Prof Brian Ripley