[Rd] a better "source(echo=TRUE)" {was "....how to pause...."}
Friedrich.Leisch at tuwien.ac.at
Friedrich.Leisch at tuwien.ac.at
Tue Nov 30 13:27:38 CET 2004
>>>>> On Tue, 30 Nov 2004 12:51:12 +0100,
>>>>> Martin Maechler (MM) wrote:
[...]
> But to do this might be more tricky than at first thought:
> Of course you can readLines() the source file and writeLines()
> them to whatever your console is. The slightly difficult thing
> is to "see" which junks to ``send to R'' , i.e. to parse() and eval().
> The basic problem seems to see when expressions are complete.
> Maybe we should / could think about enhancing parse() {or a new
> function with extended behavior} such that it would not only
> return the parse()d expressions, but also indices (byte or even
> line counters) to the source text, indicating where each of the
> expression started and ended.
> That way I could see a way to proceed.
Yes, that would be also *very* handy for Sweave, where I parse/deparse
exactly for the reasons Martin describes: to get complete expressions
and to know where output should be inserted.
.f
More information about the R-devel
mailing list