Re: [Rd] a better "source(echo=TRUE)" {was "....how to pause...."}

From: <Friedrich.Leisch_at_tuwien.ac.at>
Date: Tue 30 Nov 2004 - 23:27:38 EST

>>>>> 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



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue Nov 30 23:47:06 2004

This archive was generated by hypermail 2.1.8 : Wed 01 Dec 2004 - 01:12:29 EST