[R] Command Line Arguments

2010-07-01 Thread Bierbryer, Andrew
Do you know to pass named command line arguments into an R script?

I have used littler and argv to pass a vector of arguments, but this
requires you to maintain the order of the arguments.

I'm wondering if there is a way to do this when you do not know the
order of the arguments being passed in.

 

Thanks,

 

Andrew Bierbryer

 

 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] do.call and timeSeries

2009-11-10 Thread Bierbryer, Andrew
Peter -

I am using 2.8.1 on linux. When I use 2.10.0 on the pc, it works, so it
must be a version issue.




 sessionInfo()
R version 2.8.1 (2008-12-22) 
x86_64-pc-linux-gnu 

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.U
TF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=
C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATI
ON=C

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base





-Original Message-
From: Peter Ehlers [mailto:ehl...@ucalgary.ca] 
Sent: Tuesday, November 10, 2009 2:38 PM
To: Bierbryer, Andrew
Cc: r-help@r-project.org
Subject: Re: [R] do.call and timeSeries


Bierbryer, Andrew wrote:
 Does anyone know why the following code hangs on the do.call, but
works
 fine when I either comment out the require(timeSeries) or only do 2
 levels of a for loop instead of 3?
 
  
 
 Thanks,
 
  
 
 Andrew Bierbryer
 
  
 
  
 
  
 
 require(timeSeries)
 
  
 
 num - 1 
 
  
 
 x.list - list()
 
  
 
 for ( i in 1:10 ) {
 
   for ( j in 1:20 ) {
 
 for ( k in 1:30 ) {
 
   x.list[[num]] - cbind(num,10)
 
   num - num + 1
 
 }
 
   }
 
 }
 
  
 
  
 
 cat('calling do.call\n')
 
  
 
 x.df - do.call(rbind,x.list)
 
   
 
 cat('called do.call\n')
 
  
This seems like a highly unusual way to generate x.df,
but it works fine for me. No idea why this doesn't work
for you.

Here's my sessionInfo; what's yours?

  sessionInfo()
R version 2.10.0 Patched (2009-11-02 r50295)
i386-pc-mingw32

locale:
[1] LC_COLLATE=English_Canada.1252  LC_CTYPE=English_Canada.1252
[3] LC_MONETARY=English_Canada.1252 LC_NUMERIC=C
[5] LC_TIME=English_Canada.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

other attached packages:
[1] timeSeries_2100.84 timeDate_2100.86
 

  -Peter Ehlers

 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Returning Variables in R to Linux Shell

2009-04-22 Thread Bierbryer, Andrew
If I have an R script that I am executing from a command line in linux,
do you know how I can return the value of the variable in my R script to
the linux environment without writing it to a file in my R script and
then reading the file through cat?

 

 

For example, if I had a simple one line R script that just did

string - 'TEST',

 

when I call

/usr/local/bin/R -no-save  MY_R_FILE,

 

how can I put the value TEST into a shell variable?

 

Thanks,

 

Andrew Bierbryer

 

 

 

 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.