[R] R under Ubuntu

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Tue May 26 15:46:21 CEST 2009

On Tue, May 26, 2009 at 11:17 AM, Luis Ridao Cruz <luisr at hav.fo> wrote:
> R-help,
> I have installed R under Ubuntu and
> I'm very new to a Linux distribution.
> To open an empty R session I just type R on the Terminal aplication.
> But how can I open a saved workspace?
> At present I just start R and then load ("my_workspace") but it must be possible
> to do it all at once,,,,right?

  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

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

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).


More information about the R-help mailing list