Message-ID: <CAGxFJbTi0SPb9STcFwu1DaGA2Ynd5K6v6KWNe7=ubh_Nc3uo+g@mail.gmail.com>
Date: 2016-05-11T21:12:00Z
From: Bert Gunter
Subject: break string at specified possitions
In-Reply-To: <CAHby=D1UYkGp-L_hVgy8Xus=_wVjDmV=6_x39Dyd0Pt38-H02w@mail.gmail.com>
Dunno -- but you might have a look at Hadley Wickham's 'stringr' package:
https://cran.r-project.org/web/packages/stringr/stringr.pdf
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Wed, May 11, 2016 at 1:12 PM, Jan Kacaba <jan.kacaba at gmail.com> wrote:
> Dear R-help
>
> I would like to split long string at specified precomputed positions.
> 'substring' needs beginings and ends. Is there a native function which
> accepts positions so I don't have to count second argument?
>
> For example I have vector of possitions pos<-c(5,10,19). Substring
> needs input first=c(1,6,11) and last=c(5,10,19). There is no problem
> to write my own function. Just asking.
>
> Derek
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.