From hj at jhu.edu  Thu Sep 18 19:32:29 2014
From: hj at jhu.edu (Harris A. Jaffee)
Date: Thu, 18 Sep 2014 13:32:29 -0400
Subject: [Rd] last user argument missing from Rscript --verbose
Message-ID: <8A6E73FA-0C64-42DA-B506-01FDD7ED2204@jhu.edu>

The loop that echoes the arguments almost always stops too soon.  It apparently does that to avoid
echoing the "--args" (that had been inserted) when there are no user arguments.  However, when there
are user arguments, the next element of the 'av' array is the last argument and usually not "--args",
although it can be.

?Rscript is a little sketchy:

     ?--verbose? gives details of what ?Rscript? is doing.  Also passed
          on to R.

What is passed to R is correct, but the diagnostic is not:

 $ Rscript --verbose /dev/null 1 2
  running
  '/path_to_R --slave --no-restore --file=/dev/null --args 1'

Fixed (only tested on Mac):

 $ Rscript --verbose /dev/null 1 2
  running
  '/Library/Frameworks/R.framework/Versions/3.1/Resources/bin/R --slave --no-restore --file=/dev/null --args 1 2'

-------------- next part --------------








[Rd] last user argument missing from Rscript --verbose
Harris A. Jaffee