Skip to content
Prev 184616 / 398500 Next

How do I get just the two last tokens of each string in a vector?

Here is a similar solution using strapply in gsubfn.
The pattern matches non-spaces, [^ ]+, followed by a space
followed by non-spaces followed by end-of-string, $.
[1] "L*H H%" "H* H%"  "L*H %"  "L*H %"
On Fri, Jun 26, 2009 at 7:21 AM, Fredrik Karlsson<dargosch at gmail.com> wrote: