Skip to content
Prev 146960 / 398500 Next

parsing - input buffer overflow

On Fri, 13 Jun 2008, Daniel Malter wrote:

            
R does have limits on the command line length (1024 bytes up to R-devel, 
4096 bytes there).  What happens if you exceed that depends on the 
interface you are using (and you have not told us).  Beyond that, the 
parser has a limit of MAXELTSIZE (8192 bytes) on strings.

I don't see any need for 'improvement' though: why are you entering very 
long strings as part of the R program?  They are data, and e.g. 
readLines() and scan() have no limits on string length beyond those 
imposed by R's internals (2^31-1 bytes).
I presume that is not an example?  It looks like a character vector which 
has been collapsed by paste(x, ", ") and would be better strsplit() into 
its components than using gregexpr.