1

I'm working on developing an R package that reads/checks user file structure. Some functions in the package check to see if an .Rproj file exists in a given directory.

I've written a test for one of those functions using testthat, but am running into an issue that keeps making my test fail.

I have a folder in tests/testthat that contains a project made up of an .Rproj file, a .Rmd and an html output file. When I try to access the folder interactively in the console using fs::dir_ls, all three files show up as expected, but when running R CMD CHECK, I only see the .Rmd and the html. The .Rproj file appears to disappear into thin air.

This is the code I run:

==== INTERACTIVE (console) ====

fs::dir_ls("tests/testthat/project_noob")

Output:

tests/testthat/project_noob/project_noob.Rproj tests/testthat/project_noob/simple.Rmd tests/testthat/project_noob/simple.html

==== R CMD CHECK ====

dir <- test_path("project_noob")
fs::dir_ls(dir)

Output:

project_noob/simple.Rmd
project_noob/simple.html

Does anyone know why this might be? Is there something about the R CMD CHECK testing environment that hides .Rproj files? Is there a way to unhide them?

0 Answers0