reshape function: allow split argument to include perl

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

reshape function: allow split argument to include perl

Edward
Hi,
I'd like to request that the "split" argument of the reshape function include the perl
argument so that "splitting" is more flexible.

An example is if the varying argument contains "Q1.1.1, Q1.1.2, Q1.2.1, Q1.2.2, " etc.
Splitting on the last "dot" seems to be only possible using perl.

> x <- c("Q1.1.1", "Q1.1.2", "Q1.2.1", "Q1.2.2")
> strsplit(x, "(\\.)(?=[^\\.]$)", perl=TRUE)
[[1]]
[1] "Q1.1" "1"

[[2]]
[1] "Q1.1" "2"

[[3]]
[1] "Q1.2" "1"

[[4]]
[1] "Q1.2" "2"

Thanks.
--
Edward McNeil

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel