New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"~/Desktop" for setwd() isn't the OS standard Desktop in Windows #435

rgaiacs opened this Issue Sep 13, 2018 · 2 comments


None yet
4 participants

rgaiacs commented Sep 13, 2018

As mentioned in and confirmed by Ashwin Srinath and Pariksheet Nanda, the use of


in Windows, can send users to one folder that isn't one Desktop folder that isn't the same as the one they normally see.

We should add a note to this on the Instructors Note or a call out box on the lesson itself (when we introduce setwd(), see #332).


This comment has been minimized.

psolymos commented Sep 13, 2018

This is related to how R defines home folder after tilde expansion. On Windows it is C://Users//Foo//Documents// instead of C://Users//Foo//. You can put something like this in etc/

if (.Platform$OS.type == "windows") {

although this has a side effect when calling R from a directory, or using an R project in Rstudio -- you'll still end up in C://Users//Foo//.


This comment has been minimized.

hoytpr commented Sep 13, 2018

when R is installed on a Windows machine, the default start icon parameters are:

"C:\Program Files\R\R-3.5.0\bin\i386\Rgui.exe" --cd-to-userdocs

So the fix seems to be to tell Windows users to fix their start icon properties. Change the "start" path to

"C:\Program Files\R\R-3.5.0\bin\x64\Rgui.exe" 

(or to wherever they installed R). Then ALSO change the "Start in:" path to


(obviously not using "Foo" but the users actual username). Then R will start at the users Desktop every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment