2

I am currently developing a package for my PhD containing functions for the data analysis for my project. The setup is windows 10 and all files are saved locally on the PC and synchronised to One Drive.

I am able to build my package and was also able to check it. However I closed the R Studio and now (a few days later) that I wanted to work on it again (without changing anything from the code that was previously running with 0 errors, warnings and notes), it does not work. I can still build my package without error but I can not use devtools::check to check it. The output of devtools::check is:

enter image description here

On the Windows File Explorer I noticed that inside the package (name eEP.Analysis.V2) there is the R project folder where a lock file is not synchronized, as can be seen here:

enter image description here Is it possible that this is the cause of the problem? How can I fix this?

Thank you very much for your help.

ikempf
  • 153
  • 1
  • 10
  • 2
    Firstly `problem beim lesen von verzeichnis` in German means ` problem reading from directory` in English. Can you try moving the entire directory somewhere outside of OneDrive and try again? – stevec Nov 25 '20 at 07:20
  • 1
    I regularly experienced problems when I had project folders in syncing folders (especially OneDrive). I wouldn't recommend doing that anymore but rather using `git`. – Thomas L. Nov 25 '20 at 08:09
  • @stevec I can't unfortunately :/ Windows is not allowing me to move the files, it says I don't have the proper rights to do so. Even though I am the admin of this PC, I do not have "sufficient rights". I think the problem is the moving of the R-project part. I can copy out all the files of the package (R code etc) itself fine, the hidden R Project folder is what causes the problem. Any advice? – ikempf Nov 25 '20 at 11:20
  • @thomas-l Thank you very much for your reply. It really seems like OneDrive and RStudio don't want to work together :/ – ikempf Nov 25 '20 at 11:21
  • 1
    I think you must solve the problem of not being able to move the files, then your R problem might be non-existent. If it's a work computer, you could try your tech help desk – stevec Nov 25 '20 at 13:16
  • @stevec The problem of not being able to move the files should be caused by OneDrive not being able to sync it. I think I will in future just directly include my function files and skip the R-package step that way. Hopefully this way I can avoid the problem. Thank you very much for your help. – ikempf Nov 25 '20 at 13:28
  • The solution below didn't work for me unfortunately, but I eventually found this: https://stackoverflow.com/questions/57777382/cannot-install-an-r-package-from-github – hmhensen Jul 16 '21 at 20:10

1 Answers1

6

The problem was indeed caused by the synchronization of OneDrive and the R temporary files. Namely the files from within the R-Project folder caused the problems. The problem does not occur if the automatic synchronization to OneDrive is deactivated. So whenever I work with R I just deactivate the synchronization and this solves the problem (or at least successfully avoids it).

ikempf
  • 153
  • 1
  • 10