My first [r] post! I've taken over a project developed by a software house which consists of 4 R packages. When running through the tests I discover that whilst devtools::test() produces a clean run for one of the packages, devtools::check() does not!
The error is as below in the output:
> test_check("moment")
Error in file(file, "rt") : cannot open the connection
Calls: test_check ... FUN -> eval -> eval -> read.csv -> read.table -> file
In addition: Warning message:
In file(file, "rt") :
cannot open file 'Tables/Analysis/BobAndCheck/bob.csv': No such file or directory
Execution halted
Note that the csv file referred to is one of many csv files used to manage testthat input and expected output. It seems that when running devtools::check() the whole package (including these files) is copied to the TMPDIR location. What is odd is that the "BobAndCheck" folder is not copied (even though other folders containing similar csv files are). So the error is correct, the test file is NOT there (in the TMPDIR), but I have no idea why it is not being copied when others are! Note the top level "Tables" sits directly under the tests/testthat folder in the package structure.
I can't find any docs on why check() copies the files to the TMPDIR to run the tests (a clean package?), and no way to understand why this might go wrong!???
Any help much appreciated. Thanks.
Edited to include ignore file below (I don't believe this is causing the issue):
^.*\.Rproj$
^\.Rproj\.user$
^ReceivedV[0-9]$
^ReceivedV[0-9]MangoMod$
Edited (2) - to add that the tar file the project generates (package?) is 36.1MB. Could the size be an issue here?