Checking the R-package in RStudio: The file error does not exist (the working directory does not adapt to the project)

I want to check the package I wrote. When I click the Check button in RStudio, I get the following message:

==> devtools::check(document = FALSE)

Setting env vars --------------------------------------------------------------
CFLAGS  : -Wall -pedantic
CXXFLAGS: -Wall -pedantic
Building BBkUtils -------------------------------------------------------------
"C:/PROGRA~1/R/bin/x64/R" --no-site-file --no-environ --no-save --no-restore  \
  --quiet CMD build "U:\Eigene Dateien\R\BBkUtils" --no-resave-data  \
  --no-manual 

* checking for file 'U:\Eigene Dateien\R\BBkUtils/DESCRIPTION' ... OK
* preparing 'BBkUtils':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building 'BBkUtils_0.1.0.tar.gz'

Setting env vars --------------------------------------------------------------
_R_CHECK_CRAN_INCOMING_ : FALSE
_R_CHECK_FORCE_SUGGESTS_: FALSE
Checking BBkUtils -------------------------------------------------------------
"C:/PROGRA~1/R/bin/x64/R" --no-site-file --no-environ --no-save --no-restore  \
  --quiet CMD check  \
  "C:\Users\s1504gl\AppData\Local\Temp\RtmpSyMuXs/BBkUtils_0.1.0.tar.gz"  \
  --as-cran --timings --no-manual 

Warning: 'C:\Users\s1504gl\AppData\Local\Temp\RtmpSyMuXs/BBkUtils_0.1.0.tar.gz' is neither a file nor directory, skipping

Error: Check failed: 'U:\Eigene Dateien\R/BBkUtils.Rcheck' doesn't exist
Execution halted

Exited with status 1.

This behavior does not change if I start devtools::check()from the console R.

Interestingly, I can build the package without any problems (without checking it before). This also becomes clear from the message above. But for some reason, the package could not be found in the specified temporary folder (which really does not exist, as indicated in the message).

During the scan, the file .tar.gzis created at the same folder level above the project root. Can I somehow say devtools::check()where to look for the file .tar.gz?


Edit 1: Problem with working directory

, . U:\Eigene Dateien\R, U:\Eigene Dateien\R\BBkUtils. . ?


2:

. . , , , .

reset , .

+4
1

, , C:\Program Files\R\etc\Rprofile.site .First, U:\Eigene Dateien\R.

R .

0

Source: https://habr.com/ru/post/1679264/


All Articles