[R] parsing - input buffer overflow
Daniel Malter
daniel at umd.edu
Fri Jun 13 10:02:56 CEST 2008
Hi,
I am trying to parse a large amount of text using gregexpr(). Unfortunately,
I get an "input buffer overflow" message when I attempt that with too large
an amount of text. The error messages occurs before the parsing. The problem
is that I cannot assign the text to a variable (an object) if the text is
too large.
This problem has been mentioned before, which I found using the RSiteSearch.
However, the post is from 2006, and I thought it might have improved by now.
Is there any way to increase the limit or to get around this problem?
x="Saint Lucia, Saint Kitts and Nevis, Saint Helena, Clipperton Island,
Tristan da Cunha"
#What I want to achieve is to parse the text for the number of occurrences
of a certain character string within the text.
#This is done using:
n=100 #choose n large enough
length(which(is.na(gregexpr("Saint",x,ignore.case=TRUE)[[1]][1:n])==FALSE))
But again, if the text is large, I cannot assign it to x. I'd be grateful
for any suggestions.
Cheers,
Daniel
-------------------------
cuncta stricte discussurus
More information about the R-help
mailing list