Re: [R] interruption when pasting code into R under linux

From: Marc Schwartz (via MN) <mschwartz_at_mn.rr.com>
Date: Wed 14 Dec 2005 - 04:43:27 EST

On Tue, 2005-12-13 at 15:50 +0100, Sebastian Leuzinger wrote:
> hello,
> has anyone come across the following rather mysterious problem:
>
> when pasting large bits of code (100 and more lines) into the R console with
> the central mouse button (under linux), only part of the code is pasted, and
> the text interrupts somewhere arbitrarily. It does not happen when smaller
> bits are pasted subsequently.
>
> I use linux suse 9.3 with the latest version of R

More than likely, you are getting an input buffer overflow. The arbitrary nature of when this occurs will be dependent upon a variety of factors, including the complexity of the R code you are pasting and how fast the R interpreter can process it.

At some point, a bottleneck is created and the subsequent text in the input buffer is lost. This behavior is generally intentional to avoid security risks due to buffer overruns, which is a common method exploited by folks looking to compromise a system.

See http://en.wikipedia.org/wiki/Buffer_overrun for more information.

You can try to increase the input buffer size for the console to see if that helps. This will be dependent upon the console app you are using and the default buffer size in place.

A better solution would be to save the R code in a text file and source() that file to bring the code into R. See ?source for more information.

An even better solution, if you are comfortable with emacsen, is to use ESS. This provides for a more integrated development environment. See:

  http://stat.ethz.ch/ESS/

for more information.

HTH, Marc Schwartz



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Dec 14 06:35:47 2005

This archive was generated by hypermail 2.1.8 : Wed 14 Dec 2005 - 09:34:04 EST