views:

87

answers:

1

this sounds like a silly problem: I'm putting my R code into a package and R CMD check src complains about the .Rd~ backup files being produced by Emacs.

* checking package subdirectories ... WARNING
Subdirectory 'man' contains invalid file names:
  read.PI.Rd~ write.PI.Rd~

the documentation says: »In addition [...] files [...] with base names [...] ending in ‘~’, ‘.bak’ or ‘.swp’, are excluded by default.« (page 18). but then why the warning?

+1  A: 

Just add a file cleanup which removes them in your top-level directory. Also, you could build a tarball or zip archive first via R CMD build and the check this archive via R CMD check -- that should skip these filese as well.

Also, exactly how are you calling R CMD check, and what is your directory layout? With R 2.10.0 on Linux, I just ran touch pkg/man/foo.Rd~ for one of my packages, and R CMD check pkg (where pkg is the top-level directory as common for source projects stored on R-Forge) did not issue this warning you are seeing. The file was not removed by cleanup as that currently purges only in src.

Dirk Eddelbuettel
first building the tar.gz and then checking it does avoid the warnings. but then: the `cleanup` is not invoked during `R CMD check`, I also would not want to remove these backup files, I'd be happy with `check` ignoring them just as `build` already does. you're telling me I don't have this option?
mariotomo
Not sure. Your best bet is probably to look at the source code of 'check' in $RHOME/bin. From a very casual look it does have some tests for '~'. And as I said: this problem does not bite me, so I am not quite sure a) why it bites you and b) how you'd get around it. Hence my follow-up question.
Dirk Eddelbuettel
I'm so sorry: I was calling it with `--check-subdirs=yes`. removing that option removed the warnings.
mariotomo
No worries -- these things happen, and R has a gazillion subcommands. Congrats on doing the right thing: organising your code as packages. It is definitely worth the effort.
Dirk Eddelbuettel