Konar
April 29, 2020, 10:26am
1
Hi everyone, When I open RStudio 1.2.1335 with R version 3.6.1, I get an error message error: '\R' is an unrecognized escape in character string starting ""c:\R".
There already was someone with the same error in this post: Directory error at start up but I don't understand the solution and can't reach that user to clarify. Can someone help me out on this?
Extra info:
starting up Rstudio without doing anything results in this error:
and have the following setup in Rstudio:
The solution reported by that user involves modifying keyboard shortcuts in RStudio. You can check whether you have the same issue by going to Tools -> Modify Keyboard Shortcuts and selecting the Customized radio button.
If you have modified the keyboard shortcut for Run Current Line or Selection, it should show up here. You can then reset it to the RStudio default and see if that fixes the problem.
Konar
April 29, 2020, 1:18pm
3
Thanks for the reply: it does not seem that I modified these shortcuts, and when resetting these settings to default (just for trying it out) sadly it does not solve the error. I usually go with the setwd() within each project/Rmarkdown file, so I don't completely understand where this error comes from.
Any ideas?
Just out of curiosity, are you restoring .RData into your workspace when launching RStudio?
Konar
April 29, 2020, 1:44pm
5
No, I don't have that option checked. I just came across a unexpected error when updating packages, and it seems to be caused by the default work directory:
Could this give any information as why it does not work? I don't have any experience with this problem, so I hope this will give some more insight!
Can you check if you get the same error when opening R GUI? That'll help us understand whether the problem is with R or RStudio's configuration.
Konar
April 29, 2020, 2:08pm
7
Yes, tried it and it shows the same error as in Rstudio.
So it's likely that the issue has to do with R's configuration. What is the output of getwd() in a fresh session of R?
Konar
April 29, 2020, 2:38pm
9
Sure, it's from a networked PC at work so I blanked out some of the path:
It's on a networked drive, so it's no local folder on C:. I do have R/Rstudio installed on the C: drive.
Ah, I see. I've heard of some users encountering problems when using R with networked drives (see thread below).
opened 11:17AM - 12 Dec 18 UTC
bug
windows
remote storage
issue has been reported in the past but without solution: https://support.rstudi… o.com/hc/en-us/community/posts/200652973-Network-Drives
has been reported here without solution:
https://stackoverflow.com/questions/25268582/rstudio-desktop-0-98-1006-for-windows-unable-to-access-mapped-network-drives
Version 1.1.453 – © 2009-2018 RStudio, Inc.
Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/538.1 (KHTML, like Gecko) rstudio Safari/538.1 Qt/5.4.1
> setwd("Y:/")
Error in setwd("Y:/") : cannot change working directory
output from choose.dir()

same computer:

output from choose.dir()


Unfortunately, I'm not familiar with this type of R setup and cannot provide further assistance. Maybe someone else will be able to guide you.
Konar
April 29, 2020, 7:28pm
11
Thanks for the help so far and I will dig into the mentioned thread!
Ramon
May 1, 2020, 11:05pm
12
Have you try // instead of just /?
Konar
May 4, 2020, 8:35am
13
Yes and it does not seem to work. Thanks for your suggestion though!
Thanks for the bug report -- this sounds similar to this issue.
opened 06:47PM - 03 Apr 20 UTC
closed 04:44PM - 07 Apr 20 UTC
RStudio 1.2.5033 cannot save files (.R, .Rmd, etc) to Users home folder or any o… f its subfolders which is located on "\\\\server/path/to/USER/Daten" (Daten == Documents)
### System details
- RStudio Edition: Desktop
- RStudio Version: 1.2.5033 AS WELL AS 1.3.936
- OS Version: MS WINdows 10 Enterprise - Version: 10.0.17763 Build 17763
- R Version: 3.5.3 and 3.6.3
**Description of issue**
RStudio (1.2.5033 and 1.3.936) cannot save files (.R, .Rmd, etc) to Users home folder if is located on Windows UNC path "\\\\server/path/to/USER/Daten" (Daten == Documents)
### Steps to reproduce the problem
Open RStudio 1.2.5033
Create New (empty) file - optionally write some content into it.
Try to "Save As" ... anywhere on the (UNC path) Users home folder
### Describe the problem in detail
Not possible to save any files on a UNC path "out of the box" (see also 'Attempted steps taken to fix' below)
### Error Information:

### Describe the behavior you expected
Ability to save files - just like with RStudio 1.1.463 under UNC-PATH USER home folder or its subfolders.
**Attempted steps taken to fix**
- Replace UNC \\\\server/some/path/to/User/Documents with mapped drive letter eg: "L:/USER/Documents"; this works temporarily but is not a feasible permanent solution since after every login respectively even after restart of RStudio 1.2.5033 the same bug reappears!
- Output of diagnostics report (if possible):
see attached .pdf file - interesting sidenote RStudio managed to create (the rstudio-diagnostics folder) and write the diagnostic-report.txt file to the users (UNC path) document folder w/o applying any fixes (eg as mentioned above mapping to drive letter etc.)
[diagnostics-report.txt](https://github.com/rstudio/rstudio/files/4429320/diagnostics-report.txt)
"Interesting" sidenote RStudio 1.2.5033 managed to create (the rstudio-diagnostics folder) and write the diagnostic-report file to the users (UNC path) document folder w/o applying any prior fixes (eg as mentioned above mapping to drive letter etc.) before that action.
So it seems that UNC path access / write ability is hidden somewhere in there?
- [X] I have read the guide to submitting good bug reports at https://github.com/rstudio/rstudio/wiki/Writing-Good-Bug-Reports .
- [X] I have installed the latest version of RStudio and confirmed that the issue still persists.
- [ X] I have included a diagnostics report. https://support.rstudio.com/hc/en-us/articles/200321257-Running-a-Diagnostics-Report
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
We're hoping to have a fix for this in RStudio v1.3. As a workaround you can try the following:
For what it's worth, I believe one workaround would be to set R_USER to the same server path (as UNC), but with different casing -- e.g. with the server name capitalized. (This affects how RStudio tries to perform tilde expansion / path aliasing, which I believe is the root cause of the issue here)
Konar
May 14, 2020, 7:42am
15
Hi Kevin,
Thank you for the response and information. I will try the workaround and also look forward to RStudio v1.3!
Cheers!
system
Closed
June 4, 2020, 7:42am
16
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.