Re: [R] how does one print code

2010-04-09 Thread David.Epstein
I downloaded the code, as Duncan Murdoch suggested. I also used sink() as suggested by others and found that the two methods gave identical results. I then fixed the bug in a private file and tried it out on a number of examples. It now seems to work fine, as far as I can tell. From CRAN, I

[R] how does one print code

2010-04-08 Thread David.Epstein
There is quite a long piece of code defining a certain function in one of the R packages. I think the code has a bug and I want to get the code into a file so that I can take a proper look, and possibly fix it. how does one do this? (I mean getting the code into a file, not fixing the bug.) I

Re: [R] how does one print code

2010-04-08 Thread Phil Spector
David - You can do what you want pretty easily using sink. Suppose you want the source code for function blah in the file blah.func: sink('blah.func') print(blah) sink() - Phil Spector Statistical Computing

Re: [R] how does one print code

2010-04-08 Thread Ista Zahn
Hi David, You can use sink, like this: sink(file=lm.R) ## redirects output to the file lm.R print(lm) #prints the lm function sink() #r redirects output back to the console. Or just download the source... -Ista On Thu, Apr 8, 2010 at 10:16 PM, David.Epstein david.epst...@warwick.ac.ukwrote:

Re: [R] how does one print code

2010-04-08 Thread Duncan Murdoch
On 08/04/2010 5:16 PM, David.Epstein wrote: There is quite a long piece of code defining a certain function in one of the R packages. I think the code has a bug and I want to get the code into a file so that I can take a proper look, and possibly fix it. how does one do this? (I mean getting