1

Edit: it is actually devtools::check() who is causing this warning and not R CMD check. I just tried with R CMD check and it works with the BinaryFiles!

I feel stupid that I can't figure this out, but I want to add some data to my R-package and I put everything in inst/extdata. Unfortunately on Linux the files are recognized as an executable while they are just a NMR data file (R CMD check uses file for this).

The warning I get:

checking for executable files ... WARNING
Found the following executable files:
     inst/extdata/Sample123/10/fid
     inst/extdata/Sample22/10/fid
     inst/extdata/Sample244/10/fid
     inst/extdata/Sample281/10/fid
     inst/extdata/Sample294/10/fid
     inst/extdata/Sample396/10/fid
     inst/extdata/Sample40/10/fid
     inst/extdata/Sample452/10/fid
     inst/extdata/Sample460/10/fid
     inst/extdata/Sample9999/10/fid
   Source packages should not contain undeclared executable files.
   See section ‘Package structure’ in the ‘Writing R Extensions’ manual.

I found in the Writing R Extensions manual that I can silence this warning by adding a file called BinaryFiles at the top level of my package. I need to add one line per path, but devtools::check() keeps on complaining about these files. My BinaryFiles looks like:

inst/extdata/Sample123/10/fid
inst/extdata/Sample22/10/fid
inst/extdata/Sample244/10/fid
inst/extdata/Sample281/10/fid
inst/extdata/Sample294/10/fid
inst/extdata/Sample396/10/fid
inst/extdata/Sample40/10/fid
inst/extdata/Sample452/10/fid
inst/extdata/Sample460/10/fid
inst/extdata/Sample9999/10/fid

The file ends with an empty line. I also tried adding ./ in front of the path, but still it doesn't work. Does anybody know what I'm doing wrong?

I created a dummy package. You can find it here.

Cheers, Rico

ricoderks
  • 1,619
  • 9
  • 13
  • 1
    What exactly is the error message you get from R CMD check? Is this package in a repo somewhere that we can inspect and recreate the problem ourselves? It's much easier to help with you provide a minimal [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – MrFlick Jun 09 '22 at 12:04
  • @MrFlick at the moment the repository is private, because it belongs to a publication we are working on. I know this makes it more difficult for me to get help. I'll try to make a dummy package which I can share. – ricoderks Jun 09 '22 at 12:16
  • Just a guess but could it be that those files inadvertently were marked as executable? If you are on Linux use `chmod -x filename` to turn that off. – G. Grothendieck Jun 09 '22 at 13:39
  • @G. Grothendieck, I tried this, but I doesn't matter. I think `R CMD check` doesn't look at this, but only at the result of the `file` command in Linux. – ricoderks Jun 09 '22 at 13:47

0 Answers0