Issues with R (3.6.3) and RStudio (1.2.5033) on network mapped drive (U:)

I am having numerous issues working with R (3.6.3) and RStudio (1.2.5033) on a network mapped drive (U:) while teleworking. Here are the gory details. There are two key issues. First, I can't seem to create new projects anywhere but my home directory (U:\Documents). Second, I can't seem to save R scripts (complaints about invalid extension).

  1. I am working on a Windows 10 system with my home directory on U:\Documents which is synonamous with C:\Users<account>\Documents

1. Clear out old installations.

  • Uninstall RStudio (via add/remove programs)
  • Uninstall R (via add/remove programs)
  • Delete all installed packages (manually delete everything in c:\Users<account>\Documents\R\Libraries, which is where I have defined R_LIBS_USER)
  • Delete everything in c:\users<account>\dowloads (overkill, but just to be sure)

2. Fresh installations.

  • Installed R (3.6.3) using defaults for all options (in prior installs, I was unchecking the 32-bit veresion and creating shortcuts).
  • Test R-GUI (32 and 64-bit versons). Seems to work.
  • Install RStudio desktop for Windows (1.2.5033) using defaults for all options
  • Launch RStudio. (interestingly it tried to open a pakage I tried to create and then deleted, so some data had been saved somewhere).
  • tools->check for package updates (all packages up to date)

3. Create a new project with devtools

  • files->new project->new directory->R package using devtools
  • get "new project" dialog with "Create R package using devtools" in title. Asks for "Directory name" (blank default) and "create project as subdirectory of" ("~/" default).
  • Use "browse" button on "create project as subdirectory of" to navigate to directory where I want to create package (~/xyzzy). When I click on "open" it returns me to dialog, but nothing has changed (still has "~/" as the value).
  • This is not looking promising. Same bad behavior as before, but I persist. Just set directory name to "newproject" and proceed to click "Create Project"
  • Get an "install packages" dialog indicating that creating a project with devtools requires an updated version of the devtools. I consent to "install this package now."
  • Lots of stuff gets installed in U:\Documents\R\Libraries (value of R_LIBS_USER). Same as C:\users<account>\Documents\R\Libraries. This takes a while.
  • So, now I have a skeletal project in U:\newproject (not in U:\xyyzzy\newproject as I wanted, but I'll live) and a bunch of libraries intalled in U:\Documents\R\Libraries.

4. Try to create a new R script

  • Try to create an R script file. File->New File->R Script pops up an untitled tab. OK. But now I seem to have two RStudio sessions open. One with the new untitled tab and the other without. Both have the new project open. I try close the window without the new untitled tab. I get an R session aborted error on the session with the new untitled tab. So, now I'm going to try to shut both down and relaunch.
  • The window without the new untitled tab takes forever to shutdown (like more than 5 minutes. It's only using minimal CPU). I can't just "close window." I kill it with task manager.
  • I relaunch. File->Recent Projects->newproject gets me to the project. File->New File->R Script brings up a new "untitled" tab.
  • File->Save brings up a dialog with the default directory correctly set to the R subdirectory. I type in "getData.R" and click save. I get a dialog "The file was created as an R script however the extension you specified will change it into a file type that will no longer open as an R script. Are you sure you want to change the type of the file so it is no longer an R script?" I select "No." I get the same response with "getData" and "getData.r"

Something is broken. I suspect it's due to the mapped drive. Are there additional environment variables I need to set?

I had a similar problem, where RStudio does not recognize my network drive, but when I look a the Windows 10 File explore, I notice a red X over the drive name. When I try to open the drive (using windows file explore) the X is removed and after that everything works as normal.

If that doesn't work, go to Tools > Global options > General. What R version are you using? Make sure it is the one you just installed into "Documents".

Next. If you want to upgrade R. do that in in an R console, not RStudio. You have to navigate the correct installation as you mentioned is in Documents, an start the correct R executable there. First install installR, then use that to install/upgrade R and RTools as well. Until you get everything running install everything using the R console with R Studio closed.

Next try using the actual network address not your mapped drive address. That might work as well.

Thanks. I installed completely fresh and up to date versions of R and RStudio.

My context is a bit different than yours.

  1. My network drive (U:) contains my home directory.
  2. It is set up such that U:\Documents is effectively the same as C:\Users\account\Documents (the two paths can be used interchangeably)
  3. When I am in the office, I access the network drive. When I am out of the office (as I am now) I work with the files offline and then they subsequently synch'd using the Microsoft Synch Center.

Could you share a diagnostics report with us? I'm also curious what the output of Sys.getenv("R_USER") is on your machine.

We did fix an issue related to network drives recently in the v1.4 daily builds, if you're able to test. We're hoping to backport the fix to v1.3 if all looks well.

Easy things first (crudely anonymized).

> Sys.getenv("R_USER")
[1] "//<domain>/files/UserData/<office>/<account>/Documents"

I'm guessing you'll want me to redefine R_USER to:

U:\Documents

I have an anonymized diagnostics report, but can't paste it in (too long) or upload it (it's not a graphics file). If you give me your email address, I can email it.

Yes indeed -- that's what I would try first.

This also makes me somewhat confident that the fix we have should help resolve this issue in RStudio v1.4, since the issue indeed occurs when the home directory is specified with a UNC path. There are more details available at https://github.com/rstudio/rstudio/issues/6587, which sounds similar to the errors you're seeing.

OK. I'll give that a try and also try with the daily build. Do you still want me to send the diagnostics? If so, how?

Given what we know now, I believe we can skip the diagnostics report. Thanks!

1 Like

FWIW ... Defining R_USER=U:\Documents did the trick. Many thanks!

Awesome! I'm very glad to hear it.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.