[R] Urgent help requested to modify a script

one2luv platt.i at pg.com
Mon Oct 19 09:08:13 CEST 2009


Jim,

Many thanks .... last part of the puzzle is now solved. I have reworked the
script and now it runs with 4 arguments.

Thanks for your help.

Regards,

Ian

Jim Lemon-2 wrote:
> 
> On 10/16/2009 11:01 PM, one2luv wrote:
>> I am hoping someone will tak up this chalenge (I am new to R)
>>
>> I have inheritied an R script but need to change it. The script currently
>> includes hardcoded file locations on lines 12,166 and 167. I need to
>> modify
>> this script to allow the folder to be passed as a command line argument
>> to
>> Rscript.exe
>>
>>    
> Hi Ian,
> You can do something like this:
> 
> pdfoutputfile<-"/home/jim/R/Rplots.pdf"
> pdf(pdfoutputfile,...)
> 
> and similarly for the other instances. Unfortunately, you can't just 
> define a path and pass it as an argument, for functions like "pdf" and 
> "read.csv" won't stick the path and filename together unless you write a 
> wrapper for each function that creates the complete path/filename and 
> then passes it to the original function.
> 
> Jim
> 
> ______________________________________________
> R-help at 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/Urgent-help-requested-to-modify-a-script-tp25924237p25954069.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list