From ripley at stats.ox.ac.uk  Fri Feb 10 12:42:46 2006
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri, 10 Feb 2006 11:42:46 +0000 (GMT)
Subject: [Rd] R CMD build: "Subdirectory 'R' contains invalid file names"
In-Reply-To: <59d7961d0602100308nafeec66n4ce873d1e44db565@mail.gmail.com>
References: <59d7961d0602100227s5e1d3dbahbfcca5dd386b02d3@mail.gmail.com>
	<17388.28445.832529.327685@mithrandir.hornik.net>
	<59d7961d0602100308nafeec66n4ce873d1e44db565@mail.gmail.com>
Message-ID: <Pine.LNX.4.64.0602101141150.4273@gannet.stats.ox.ac.uk>

On Fri, 10 Feb 2006, Henrik Bengtsson wrote:

> Hi,
>
> On 2/10/06, Kurt Hornik <Kurt.Hornik at wu-wien.ac.at> wrote:
>>>>>>> Henrik Bengtsson writes:
>>
>>> Hi, I get
>>> * excluding invalid files from 'R.oo'
>>> Subdirectory 'R' contains invalid file names:
>>>   attachLocally.Object.Rex Exception.Rex extend.default.Rex
>>>   InternalErrorException.reportBug.Rex Package.Rex Person.Rex Rdoc.Rex
>>>   setMethodS3.Rex StaticFields.Rex
>>
>>> when running R CMD build in R v2.3.0 devel.  I do understand what is
>>> going on.  In my *.R files I keep so called Rdoc comments which in
>>> their simplest form are Rd code wrapped up in plain comments.  These
>>> are compiled into Rd files written to ../man/ (I do this prior to
>>> building packages).  Rdoc also supports inclusion of other files, e.g.
>>> @include "Person.Rex" to include example code.
>>
>>> With this structure I can, when I develop/maintain a package, have
>>> <pkg>/R/ as the working directory, modify my *.R files and re-source
>>> them from within R.  Since I keep all my Rd example code in separate
>>> *.Rex files, I can easily rerun/test these by sourcing them too.  I
>>> find this very convenient.
>>
>>> In previous versions, the *.Rex files was included when building a
>>> source distribution of a package.  In R v2.3.0 they are excluded.
>>> However, I would like to distribute the *.Rex files with my
>>> source-code package too (so I do not have to keep another type of
>>> source distribution).  Note that these files are only needed for
>>> further development of the package, but *not* to install the package
>>> from source (since their contents is already incorporated in the Rd
>>> files).  They are also not of interest to the end-user.
>>
>> Henrik,
>>
>> I am not sure I fully understand the issue.
>>
>> The
>>
>>    Note that these files are only needed for further development of the
>>    package
>>
>> suggests that these files are only needed for your local master sources,
>> but not in the source package created by R CMD build.  If this is the
>> case, then you really don't have to do anything, because R CMD build
>> will happily exclude these files, and R CMD check on the .tar.gz will no
>> longer find them.
>
> Yes.  However, I would like to avoid to keep a version of "local
> master sources".  Until now, all necessary code in my packages are
> available in the *.tar.gz files build by R CMD build.  This is
> convenient if someone else wants to contribute/add to my package, the
> *.tar.gz is all that is needed and it is available on the web.  I can
> also update my package on request, say, when I travel, without having
> access to my "local master sources".  Kind of a poor man's
> subversion/cvs.

And inconvenient to everyone who has to pay to download your development 
files that they do not need.

Can you not put your master sources on your own web site.

>
> Thanks
>
> Henrik
>
>> Best
>> -k
>>
>>> My question is how to incorporate the *.Rex files?  Here are some
>>> ideas, that I would like to have some feedback on:
>>
>>> 1) Put them in <pkg>/R/Rex/*.Rex.  However, Section 1.1.4 in Writing R
>>> Extensions suggest that subdirectories of R/ may only(?) be named
>>> 'windows' or 'unix'.
>>
>>> 2) Rename them to <pkg>/R/*.in, cf. Section 1.1.4.  Is this the
>>> purpose of *.in files?  Will it have side effects?
>>
>>> 3) Put the in <pkg>/inst/<dir>/*.Rex.  This will work, but then they
>>> will also be install and available in system.file("<dir>",
>>> package="<pkg>").  Not a big problem, but not what I want.
>>
>>> 4) To avoid (3), put the in <pkg>/<dir>/*.Rex, i.e. at the top level
>>> directory.  Is this allowed?  Section 1.1.4 says "Note that [...]
>>> information files at the top level of the package will not be
>>> installed". Does this mean that they will be included in the source
>>> distribution and what about top level directories?
>>
>>> 5) Put the in <pkg>/src/*.Rex.  Can src/ be used this way too?
>>
>>> 6) Ask R-core to revert back to pre-R v2.3.0 and allow other files in
>>> the R/ directory too.  Are more people than I interested in this?
>>
>>> I realize I can test the above by trial and error, but I will still
>>> not be sure what is the right approach here.  Comments/feedback is
>>> appreciated.
>>
>>> Thanks
>>
>>> Henrik
>>
>>> ______________________________________________
>>> R-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>>
>
>
> --
> Henrik Bengtsson
> Mobile: +46 708 909208 (+1h UTC)
>
> ______________________________________________
> 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] R CMD build: "Subdirectory 'R' contains invalid file names"
Prof Brian Ripley