[Rd] RE: [R] Strange (non-deterministic) problem with strsplit

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Sat 17 Jul 2004 - 18:44:43 EST

>>>>> "HenrikB" == Henrik Bengtsson <hb@maths.lth.se> >>>>> on Sat, 17 Jul 2004 01:59:17 +0200 writes:

    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

> gsub(" ", "", "b c + d | a * b", perl=TRUE)
NULL
> gsub("\\s", "", "b c + d | a * b", perl=TRUE)
NULL
> gsub("\\s", "", "bc + d | a * b", perl=TRUE)
[1] "bc+d|a*b"
> gsub(" ", "", "bc + d | a * b", perl=TRUE)
[1] "bc+d|a*b"
>

Martin Maechler, ETH Zurich



R-devel@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-devel Received on Sat Jul 17 18:49:19 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:02 EST