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
Rwill 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