Re: [R] Scripting with an external editor

About this list Date view Thread view Subject view Author view Attachment view

From: AT (TyagiAnupam@aol.com)
Date: Mon 31 Mar 2003 - 04:42:31 EST


Message-id: <3E873A96.9090905@aol.com>


If you are not trying to write R editing functionality for an editor other than (X)Emacs or WinEdt, what you describe below is already available in these editors using ESS with (X)Emacs and R macros for WinEdt.

John Fox's enhancements for using ESS with Xemacs at page below. You can also use ESS alone, without these enhanced menus, etc.
http://www.socsci.mcmaster.ca/jfox/Books/Companion/ESS/

Look at Editing Support section on the following CRAN page.
http://cran.r-project.org/other-software.html

Jim Lemon wrote:

Hi again,

If my trawling through the "connections" code is correct, a pipe
connection is designed to read to EOF before returning its input to the
parsing function. Blocking is not an option with this type of connection.
As I do not know how to spoof an EOF on an open pipe, it looks like I
would have to rewrite 3 or 4 fairly low level functions to return input on
EOL.

My impression is that this is the wrong way to go about this. After all, I
am sure that something similar is already being done using the present
connection functions. Any suggestions as to where else I might look would
be greatly appreciated.

OS - Linux
R v1.5.1

To reiterate, what I am attempting to do is to send selected text from an
external editor to the R command line, where it will be processed as if
entered from the keyboard. I have accomplished everything except getting
the selections of text which are sent from the external editor to be
processed individually rather than all in a bunch when the external editor
exits. For example:

Select the following text in the editor and send it:

cat("Mean of x\n")
x<-1:10
mean(x)

R shows:

Mean of x
[1] 5.5

Select more text and send it:

cat("Sum of x\n")
sum(x)

R shows:

Sum of x
[1] 55

What happens now - selections are sent, but nothing happens until the
external editor is closed, at which point, R shows:

Mean of x
[1] 5.5
Sum of x
[1] 55


Thanks,

Jim

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:31 EST