`devtools::check()` works in console but not in build pane

Dear Posit community,
In my R package development process, I constantly check my progress using devtools::check() via Ctrl+Shift+D, so that it is checked in a separate session in the build pane. I resumed the development of an old package and now I am getting the following error (see image below). Yet, the file joyn-Ex.R is not part of my project directory. It seems to me that it is created by devtools during the checking process.


However, when I execute devtools::check() directly in the console, everything seems to be working fine and no error pops up (see below).


My institution recently updated my laptop, which makes me think that some configuration has changed, but I have no idea where could it be.
I would highly appreciate your help


Is your package open-source? Can you share it with us?

yes, it is. here you go:


One more piece of information: the same behavior happens with devtools::document(). when executed in the console, it works fine. When executed in the build pane (Ctrl+Shift+E) it fails if the function I am documenting is completely new. If the function has been documented before, documenting in the build pane works fine. See example below. I created a testing function new_function().

In the build pane

In the console


Does devtools::dev_sitrep() return anything useful?

Hi Maelle, Thanks.
It returns this

I am updating everything now.

For what it's worth, I cloned your repository and was able to run the check in both the console and the build pane.

Other questions: do you have write access to the folder where your package source is? Could the space in the path ("OneDrive - WBG") be problematic? Could OneDrive itself be problematic?

And a note: to update the local dependencies of a package project you can use pak::pak() instead of devtools::install_dev_deps(), it's faster to type. :grin:

Hi @maelle ,

Thank you for your message. Maybe OneDrive is the problem, but how can I know? the weird thing is that devtools::check() works fine in the console but it does not in the build pane. if they are using the same folders, why would the OneDrive Path be a problem? Unless, console and build pane use different paths, I don't understand the problem. Is there something I can do to test?


I'm not sure, maybe they create the check folders in different places?
Could you try placing a copy of your package in another folder where you are sure you have write access and where there are no space in the path, just to see if it works?

Hi @maelle ,

Yeap, that made it to work. however, It does not seem feasible to me and my team. By my organization's policies, our projects must be backed up in OneDrive, and, surprisingly and frustrating enough, the name of the OneDrive folder has spaces in it by default. There is no way to change it.

Ouch, I'm sorry to read that's the reason for the problem and not fixable.

To run R CMD check regularly, you could maybe have your package source on GitHub (in a private or public repository) and use continuous integration (in a private repo, the number of monhtly minutes is limited, see GitHub pricing info). You could also set up continuous integration on GitLab or any other Git platform.

Now, I have no idea how Git and One Drive would interact. I wonder (more or less thinking out loud) if you could

  • have your package source in a local folder that's not in One Drive
  • set up two Git remotes, one of them being the One Drive folder. So every time you'd push, you'd push to both a remote remote (on, say, GitHub), and to the One Drive folder. Example blog post about having two remotes; how to set up a local folder as remote. If you push regularly, the One Drive folder is effectively a backup, and you can use R CMD check as you will.

This topic was automatically closed after 45 days. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.