Skip to content
Prev 181452 / 398502 Next

R under Ubuntu

On Tue, May 26, 2009 at 11:17 AM, Luis Ridao Cruz <luisr at hav.fo> wrote:
By default R will normally load a .RData file from the working
directory where you start R. It will save this when you quit and say
'yes' to the "Save workspace image?" question.

 So if you make a working folder from the command line shell, change
to that folder, and start R, it will pick up any .RData file that
might be there. For example:

mkdir foo
cd foo
R

and it will use a .RData file there if there is one, and save the
workspace there when you quit. Then you can do:

cd ..
mkdir bar
cd bar
R

and you'll get a separate .RData file in subdirectory 'bar'.

 If you are a linux beginner then you might not have noticed files
beginning with 'dot' - they are generally hidden by the 'ls' command
unless you add the '-a' option (ie do "ls -a").

 If you read the help(Startup) in R you'll see:

     It then loads a saved image of the user workspace from '.RData' if
     there is one (unless '--no-restore-data' or '--no-restore' was
     specified on the command line).

Barry