Well, i have my System not set up to run from command line, so i can't help you there, but the scipt solution
id<-1 Sweave('test.Rnw') #printing out the id works fine for me. There were several other suggestions in the answers given in the link. Am 07.06.2012 um 09:30 schrieb Manish Gupta: > Hi, > > I followed the link u provided but getting some error. > > R -e "Sweave('MyReport.Rnw')" --args PatientId=1 > > i am keeping commandArgs(TRUE) in my Rnw file. print(PatientId) // Error: > chunk 2 Error in print(PatientId) : object 'PatientId' not found Execution > halted > > > Any working example will help me a lot. > > -- > View this message in context: > http://r.789695.n4.nabble.com/How-to-Read-command-line-parameters-in-Sweave-tp4632493p4632644.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. [[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.