R - testthat using data file outside the testing directory
问题 I am using testthat to test a package with a file tree similar to the following: . ├── data │ └── testhaplom.out ├── inst │ └── test │ ├── test1.r │ ├── tmp_S7byVksGRI6Q │ │ └── testm.desc │ └── tmp_vBcIkMN1arbn │ ├──testm.bin │ └── testm.desc ├── R │ ├── haplom.r │ └── winIdx.r └── tmp_eUG3Qb0PKuiN └── testhaplom.hap2.desc In the test1.r file, I need to use the data/testhaplom.out file as input data for a certain function, but if I do test_file(test1.r) , it changes into the inst/test