blue sky
2010-Feb-12 05:35 UTC
[Rd] filenames with special characters in the R/ directory of a package?
According to R-exts.pdf (page 3): For maximal portability filenames should only contain only ASCII characters not excluded already (that is A-Za-z0-9._!#$%&+,;=@^(){}?[] I have some files with special characters like '[' and '%' e.g. '[.set.R'. 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?> library(my.pkg)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'
Barry Rowlingson
2010-Feb-12 08:36 UTC
[Rd] filenames with special characters in the R/ directory of a package?
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 > A-Za-z0-9._!#$%&+,;=@^(){}?[] > > I have some files with special characters like '[' and '%' e.g. > '[.set.R'.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? > >> library(my.pkg) > 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". Barry