I found this code:
string = c("G1:E001", "G2:E002", "G3:E003")
> sapply(strsplit(string, ":"), "[", 2)
[1] "E001" "E002" "E003"
clearly strsplit(string, ":")
returns a vectors of size 3 where each component i is a vector of size 2 containing Gi
and E00i
.
But why the two more arguments "[", 2
have the effect to select only those E00i
? As far as I see the only arguments accepted by the function are:
sapply(X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE)