Re: [R] documenting yoru progress

2007-12-03 Thread tom sgouros
Duncan Murdoch <[EMAIL PROTECTED]> wrote: > I think Gabor has answered your question directly, but another > approach to solve the same underlying problem might be to work with > Sweave. (Or ODFweave, etc.) Thank you, that is pretty marvelous. I will use it next time around. -tom -- ---

Re: [R] documenting yoru progress

2007-12-03 Thread Duncan Murdoch
On 12/2/2007 6:24 PM, Tom Sgouros wrote: > Hello all: > > I have a function that writes a fairly elaborate report based on some > survey data. For documentation and bookkeeping purposes, I'd like to > write out in the report the function call that produced the report, or > at least enough informa

Re: [R] documenting yoru progress

2007-12-02 Thread Gabor Grothendieck
Use format: f <- function(x) { format(match.call()) } f(pi + 3) On Dec 2, 2007 8:46 PM, tom sgouros <[EMAIL PROTECTED]> wrote: > > Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > > > Try this: > > > > > survey.write <- function(x) { > > +print(match.call()) > > +x > > + } > > >

Re: [R] documenting yoru progress

2007-12-02 Thread tom sgouros
Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Try this: > > > survey.write <- function(x) { > +print(match.call()) > +x > + } > > out <- survey.write(pi+3) > survey.write(x = pi + 3) That's exactly what I need. Thank you. But now, another question. I can't seem to get the value ret

Re: [R] documenting yoru progress

2007-12-02 Thread Gabor Grothendieck
Try this: > survey.write <- function(x) { +print(match.call()) +x + } > out <- survey.write(pi+3) survey.write(x = pi + 3) On Dec 2, 2007 6:55 PM, tom sgouros <[EMAIL PROTECTED]> wrote: > > > Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > > > If what you mean is that you have a file, te

Re: [R] documenting yoru progress

2007-12-02 Thread tom sgouros
Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > If what you mean is that you have a file, test.R, of R commands > and you are using source("test.R") and you wish to discover the > name "test.R" without hard coding it in your file, then place this in > test.R: > > ofile <- parent.frame(2)$ofile

Re: [R] documenting yoru progress

2007-12-02 Thread Gabor Grothendieck
If what you mean is that you have a file, test.R, of R commands and you are using source("test.R") and you wish to discover the name "test.R" without hard coding it in your file, then place this in test.R: ofile <- parent.frame(2)$ofile and ofile will be set to "test.R". Note that the line shown

[R] documenting yoru progress

2007-12-02 Thread Tom Sgouros
Hello all: I have a function that writes a fairly elaborate report based on some survey data. For documentation and bookkeeping purposes, I'd like to write out in the report the function call that produced the report, or at least enough information to help me recreate the steps that led to that