Skip to content

Strange (non-deterministic) problem with strsplit

4 messages · Henrik Bengtsson, Martin Maechler, Duncan Murdoch +1 more

#
[Moving this thread to R-devel instead]

I suspect your "random" results are due to a bug in gsub(). On my R v1.9.0
(Rterm and Rgui) R crashes when I do

% R --vanilla
Trying
and I'll get NULL. With
it works as expected. So there is something buggy for sure.

This might have been fixed in R v1.9.1 or its patched version. (I'm still
busy to recover from a HDD crash, but, yes, I will update to Rv1.9.1. BTW,
what's the name of the error logger for Windows that is once in a while
recommended on this list and that gives more detailed errors than the
default Windows one?)

Cheers

Henrik
#
HenrikB> [Moving this thread to R-devel instead] I suspect
    HenrikB> your "random" results are due to a bug in
    HenrikB> gsub(). On my R v1.9.0 (Rterm and Rgui) R crashes
    HenrikB> when I do

    HenrikB> % R --vanilla
    >> gsub(" ", "", "abb + c | a*b", perl=TRUE)

    HenrikB> Trying

    >> gsub(" ", "", "b c + d | a * b", perl=TRUE)

    HenrikB> and I'll get NULL. With

    >> gsub("\\s", "", "bc + d | a * b", perl=TRUE)

    HenrikB> it works as expected. So there is something buggy
    HenrikB> for sure.

    HenrikB> This might have been fixed in R v1.9.1 or its
    HenrikB> patched version.

probably not.  Here are results from 1.91-patched
NULL
NULL
[1] "bc+d|a*b"
[1] "bc+d|a*b"
Martin Maechler, ETH Zurich
#
On Sat, 17 Jul 2004 01:59:17 +0200, "Henrik Bengtsson"
<hb@maths.lth.se> wrote:

            
I think you mean DrMinGW, available from the mingw-utils bundle on
www.mingw.org.

I've put together a page of debugging tips (with a Windows emphasis)
at

 http://www.stats.uwo.ca/faculty/murdoch/software/debuggingR

It's still fairly new, so there are likely important details missing;
please pass them on to me, or tell me which advice doesn't work for
you.

Duncan Murdoch
9 days later
#
Yes, that is a bug that I found a while back and now we have a replacement
for the CVS archive is in 1.9.1 patched.  However, it is in
gsub(perl=TRUE) only, and Hadley was not using anything like that.
On Sat, 17 Jul 2004, Henrik Bengtsson wrote:

            
Dr. Mingw.  See the rw-FAQ Q7.4.  (FAQs are always worth consulting.)