[R] Stack overflow in R 2.10.0 with sub()

Kenneth Roy Cabrera Torres krcabrer at une.net.co
Tue Oct 27 15:46:26 CET 2009


Dr. Murdoch:

I am puzzled!
As you adviced me I do this:

x <- as.character(alumnos$AL_NUME_ID)
x <- x[-seq_len(length(x)/2)]
y <- gsub("(^ +)|( +$)","",x)

And it fails,

But, trying to locate the problem I do:

x <- as.character(alumnos$AL_NUME_ID)
x <- x[-seq_len(length(x)/2)]
x <- x[seq_len(length(x)/2)]
y <- gsub("(^ +)|( +$)","",x)

works

x <- as.character(alumnos$AL_NUME_ID)
x <- x[-seq_len(length(x)/2)]
x <- x[-seq_len(length(x)/2)]
y <- gsub("(^ +)|( +$)","",x)

works

Now, both works!!!

So, I am puzzle!!! I cannot locate the problem.
Thank you for your advice.

Kenneth




More information about the R-help mailing list