[Rd] reshape function: allow split argument to include perl

Edward McNeil edward.m at psu.ac.th
Thu Mar 8 21:05:36 CET 2018


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



More information about the R-devel mailing list