[R] create n suffixes of length 1:n from string of length n

Witold E Wolski wewolski at gmail.com
Wed Oct 19 17:01:10 CEST 2016


Is there a build in function, which creates n suffixes of length 1:n
from string of length n?
e.g given abcd

produces
"a"
"ab"
"abc"


FAST.

equally nice to have would be:

e.g.
given c("a", "b", "c")
produces
"a"
"a","b"
"a","b","c"

Thank you
Witold


-- 
Witold Eryk Wolski



More information about the R-help mailing list