command line arguments to R
Pierre Kleiber
pkleiber at honlab.nmfs.hawaii.edu
Wed Aug 4 19:38:17 CEST 2004
Stephen Eglen wrote:
> > I normally get R started within ess using a bash script containing:
> > emacs -f R
> >
> > I'm searching for a way to add a command line argument to R, but with no
> > luck so far. I figure some kind of lisp wrapper function would do, but my
> > lisp abilities are very primitive. Any suggestions?
> >
> > My system is linux, emacs 21.3.1, ess-5.2.2, R-1.9.1.
>
> Hmm, I'm not sure you can do it all from the command line. I just
> tried something like:
>
> emacs --eval='(R "--verbose")'
>
> but that just gets Emacs to prompt you for the actual args you want to
> pass, so the `--verbose' is treated as a flag just to say that you
> want to pass some args interactively.
>
> Could you describe what args you would like to pass to R, and how
> often you would like to change them?
I'd like to set up a script to pass the -q arg... just set it up once,
not change it frequently.
>
> Since you are using ESS 5.2.2, fow now you might get some mileage out
> of the following approach that was introduced in 5.2.x:
>
> Create a shell script called R-1.9.1-my which contains
>
> ----------------------------------------------------------------------
> #!/bin/sh
> R --my-args --that -I want to pass to R
> ----------------------------------------------------------------------
>
> make this executable and put it on your path, then restart Emacs and
> edit a file say foo.R
>
> then look into the ESS -> Start Process -> Other menu and hopefully
> you will see an entry "R-1.9.1-my". If so, great; if not do
> C-h v exec-path and check your script is in one of those directories.
>
> Finally, as long as your new script is on the menu you can then do:
>
> % emacs -f R-1.9.1-my
I made the shell script, and it's in my exec path, but it's not recognized
as a lisp function, which is what I believe the -f arg to emacs needs.
Doing the above, I get: "Symbol's function definition is void: R-1.9.1-my"
>
> and you'll get the desired behavior.
>
> Stephen
>
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/ess-help
>
>
--
-----------------------------------------------------------------
Pierre Kleiber, Ph.D Email: pkleiber at honlab.nmfs.hawaii.edu
Fishery Biologist Tel: 808 983-5399/737-7544
NOAA FISHERIES - Honolulu Laboratory Fax: 808 983-2902
2570 Dole St., Honolulu, HI 96822-2396
-----------------------------------------------------------------
"God could have told Moses about galaxies and mitochondria and
all. But behold... It was good enough for government work."
More information about the ESS-help
mailing list