Skip to content
Prev 304976 / 398506 Next

[Rscript] difficulty passing named arguments from commandline

Hi Tom,

Using the script below I had no trouble. Here's an example 

Minke:R ben$ Rscript --no-init-file ./argCatcher.rs ./the=trouble .with=./args is=the.y argue
./the=trouble
.with=./args
is=the.y
argue


# script starts here
# argumentCatcher.rs
args = commandArgs(trailing = TRUE)
cat(args, sep = "\n")
q(runLast = FALSE, status = 0, save = "no") 
# script ends here

What does your R --version report?

Minke:R ben$ R --version
R version 2.15.0 (2012-03-30)
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)


Cheers,
Ben
On Sep 6, 2012, at 7:27 PM, Tom Roche wrote:

            
Ben Tupper
Bigelow Laboratory for Ocean Sciences
180 McKown Point Rd. P.O. Box 475
West Boothbay Harbor, Maine   04575-0475 
http://www.bigelow.org