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? Thanks in advance
I think it is standard practice. If you want R to load a workspace automatically when R is launched, you can add the command in .Rprofile. See ?Startup for more on Initialization at Start of an R Session. Ronggui 2009/5/26 Luis Ridao Cruz <luisr at hav.fo>:> 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? > > Thanks in advance > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- HUANG Ronggui, Wincent PhD Candidate Dept of Public and Social Administration City University of Hong Kong Home page: http://asrr.r-forge.r-project.org/rghuang.html
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 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