Andrew Robinson-6 wrote:
>
> A hack would be to use gsub() to prepend e.g. XXX to the keywords that
> you want, perform a strsplit() to break the lines into component
> strings, and then substr() to extract the pieces that you want from
> those strings.
>
> Cheers
>
> Andrew
>
Thanks, that go
-project.org] On
Behalf Of sunny
Sent: Wednesday, May 04, 2011 5:09 PM
To: r-help@r-project.org
Subject: [R] split character vector by multiple keywords simultaneously
Hi. I have a character vector that looks like this:
> temp <- c("Company name: The first company General Manager:
A hack would be to use gsub() to prepend e.g. XXX to the keywords that
you want, perform a strsplit() to break the lines into component
strings, and then substr() to extract the pieces that you want from
those strings.
Cheers
Andrew
On Wed, May 04, 2011 at 04:08:40PM -0700, sunny wrote:
> Hi. I
Hi. I have a character vector that looks like this:
> temp <- c("Company name: The first company General Manager: John Doe I
> Managers: John Doe II, John Doe III","Company name: The second company
> General Manager: Jane Doe I","Company name: The third company Managers:
> Jane Doe II, Jane Doe II
4 matches
Mail list logo