[Rd] filenames with special characters in the R/ directory of a package?
Prof Brian Ripley
ripley at stats.ox.ac.uk
Fri Feb 12 12:10:54 CET 2010
'Writing R Extensions' does say what names are allowed in the R
directory (at the start of section 1.1.3 in section-numbered formats).
The R subdirectory contains R code files, only. The code files to be
installed must start with an ASCII (lower or upper case) letter or
digit and have one of the extensions .R, .S, .q, .r, or .s.
'[.set.R' does not meet that rule, and so is skipped. This is not
something R CMD check reports, since the wording implies that other
names can be used for files to be not installed.
On Fri, 12 Feb 2010, Barry Rowlingson wrote:
> On Fri, Feb 12, 2010 at 5:35 AM, blue sky <bluesky315 at gmail.com> wrote:
>> According to R-exts.pdf (page 3):
>> For maximal portability filenames should only
>> contain only ASCII characters not excluded already (that is
>> I have some files with special characters like '[' and '%' e.g.
> That character list in your extract from R-exts.pdf is a list of
> non-special characters. And [ and % are in there.
> It's clarification of three sentences previous, which says:
> "the characters ‘"’, ‘*’, ‘:’, ‘/’, ‘<’, ‘>’, ‘?’, ‘\’, and ‘|’ are
> not allowed in file names"
>> I also have some functions that also have those special
>> characters defined in those files exported in NAMESPACE.
>> I use the following command to install. And I get no warning or errors.
>> R CMD INSTALL -d -l my_custom_dir my.pkg
>> I then load the package. I get the following errors and warnings. I
>> changed a file to one without these special characters. Then the
>> corresponding warning/error disappears. Is it the case that there
>> should never be files with special characters as names?
>> Error in namespaceExport(ns, exports) :
>> undefined exports: %is%
>> In addition: Warning message:
>> S3 methods ‘[.set’ were declared in NAMESPACE but not found
>> Error: package/namespace load failed for 'my.pkg'
> Have you done an R CMD check on your package? I suspect a problem in
> your NAMESPACE file, but it's not related to "special characters".
> R-devel at r-project.org mailing list
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
More information about the R-devel