Skip to content
Prev 166714 / 398502 Next

Loading workspaces from the command line

Well, that isn't ideal for my purposes. (A little context - basically
I have a script that I'm running for a lot of simulations, which is
kinda buggy, and what I'm doing is I'm having the script periodically
save whatever it has done so far to an automatically named file. Then
if something odd happens in between two saves, I can run forward from
a previously saved point to find the problem and figure out why it
happened, and also I won't risk losing everything if something
catastrophic happens.)

Anyways, if anyone's interested, in .Rprofile

.First <- function(){
  if (rev(commandArgs())[2] == "ld"){
    load(rev(commandArgs())[1], .GlobalEnv)
  }
}

Then e.g.

alias Rload='R --arg ld'

or make a bash script with

gnome-terminal --command "R --args ld $1"

and set some Open With options, and you'll be about to open R
workspaces from Nautilus etc by point and click.

Zhou


On Mon, Jan 12, 2009 at 3:14 PM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote: