From edd at debian.org  Sun Sep 21 21:16:25 2014
From: edd at debian.org (Dirk Eddelbuettel)
Date: Sun, 21 Sep 2014 14:16:25 -0500
Subject: [Rd] last user argument missing from Rscript --verbose
In-Reply-To: <253EB04F-B3EF-4A02-A619-233C08F5CF24@jhu.edu>
References: <8A6E73FA-0C64-42DA-B506-01FDD7ED2204@jhu.edu>
	<21532.7626.215119.24473@stat.math.ethz.ch>
	<CAE3=dmesQDO3L-dJFKUTv8kjE5jK2Hq4Y9H5skdn6Gh81gtRug@mail.gmail.com>
	<18372662-053A-4D6D-B3AB-78EA467CC1F3@jhu.edu>
	<CAPRP4-eeRiPs8wp2i3t8X1bLtroTJCL4CJSnWAhqJDVj+x5Hsw@mail.gmail.com>
	<253EB04F-B3EF-4A02-A619-233C08F5CF24@jhu.edu>
Message-ID: <21535.9225.537032.156237@max.nulle.part>


On 20 September 2014 at 19:55, Harris A. Jaffee wrote:
| Terrific, and I appreciate your thoughts and encouragement.
| 
| So, getting back on-list, I propose a backward-incompatible change, with
| or without --verbose, that the --args be included in the 'av' array, and
| passed to R, only if there are user arguments to follow it.  The condition
| for a first argument, at the time --args is currently included, is
| 
| 	(i0+1) < argc
| 
| Scott's fix, already in the devel version, solves my original complaint and
| should continue to do so, as long as av[ac] continues to be the terminating
| NULL.  That is, av[ac-1] is the last argument in the R command.

In case you were unaware of it, r from littler (which has been around even
longer than Rscript) has always propagated its arguments into argv:

edd at max:~$ r -e'print(argv)' foo bar biz x=42
[1] "foo"  "bar"  "biz"  "x=42"
edd at max:~$ 

See http://dirk.eddelbuettel.com/code/littler.html and my blog pages on
littler at http://dirk.eddelbuettel.com/blog/code/littler/ for more about 'r'
and littler; pre-built binaries exist at CRAN for Debian and Ubuntu; and it
builds easily on a lot of other OSs.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



[Rd] last user argument missing from Rscript --verbose
Dirk Eddelbuettel