Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread cls59
Yihui Xie wrote: Hi everyone, I want to modify two base R functions 'parse' and 'deparse' immediately after R has started, so I added some code in the file 'Rprofile.site' under the 'etc' directory. Here is a simple example: parse=function(...){ base::parse(...) } I'll get

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Duncan Murdoch
On 04/10/2009 12:41 PM, cls59 wrote: Yihui Xie wrote: Hi everyone, I want to modify two base R functions 'parse' and 'deparse' immediately after R has started, so I added some code in the file 'Rprofile.site' under the 'etc' directory. Here is a simple example: Why not just modify their

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread cls59
Duncan Murdoch-2 wrote: Why not just modify their source, and rebuild R? Duncan Murdoch In my case, the IT guys don't always provide the necessary tools and/or permissions to do this. Which is why we are fortunate that R is so flexible as to allow modification of core routines in

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Yihui Xie
Thanks a lot, Charlie. What a coincidence -- I'm also working on Sweave functions. parse() and deparse() can make the code more tidy (they are used in source() and RweaveLatexRuncode()), RweaveLatex function () { list(setup = RweaveLatexSetup, runcode = RweaveLatexRuncode, writedoc =

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Duncan Murdoch
On 04/10/2009 6:07 PM, Yihui Xie wrote: Thanks a lot, Charlie. What a coincidence -- I'm also working on Sweave functions. parse() and deparse() can make the code more tidy (they are used in source() and RweaveLatexRuncode()), RweaveLatex function () { list(setup = RweaveLatexSetup,

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread cls59
Yihui Xie wrote: Thanks a lot, Charlie. What a coincidence -- I'm also working on Sweave functions. parse() and deparse() can make the code more tidy (they are used in source() and RweaveLatexRuncode()), RweaveLatex function () { list(setup = RweaveLatexSetup, runcode =

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Yihui Xie
Hi Charlie, Thanks a lot! Your dark voodoo really helps! And also, thanks so much to Duncan for your detailed explanation! Finally I used Charlie's trick to modify makeRweaveLatexCoderunner(), and has left parse() deparse() untouched. Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: