Glam Prestige Journal

Bright entertainment trends with youth appeal.

I have just started using R and want to change the default directory from '/home' to a user specified one.

1 Answer

You can set R's working directory by… changing the directory from where you run it from. So

cd /foo/bar
R

will start R in /foo/bar.

If you want to always start R in a particular directory, you can change the working directory in the application starter. To achieve that, you need to create a copy of the application starter /usr/share/applications/R.desktop in your user application starter directory ~/.local/share/applications/ and add a line starting with Path= and then insert the desired path name.

Short example for the command line:

echo "Path=/foo/bar" | cat /usr/share/applications/R.desktop - > ~/.local/share/applications/R.desktop

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy