[R] sub / gsub - extracting between identical symbols

From: Daniel Malter <daniel_at_umd.edu>
Date: Thu, 20 Nov 2008 03:08:44 -0500


Hi, I am trying to extract some numbers from a text string. The problem is that the delimiting symbols are identical so that I do not know how to tell "sub" between which of them to extract.

The string looks like this

12/01/03/08

The extracted variables should look like:

x1=12
x2=01
x3=03
x4=08

If anybody could help or point me to useful help, I would be greatful.

Cheers,
Daniel



cuncta stricte discussurus

R-help_at_r-project.org mailing list
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. Received on Thu 20 Nov 2008 - 08:10:20 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 20 Nov 2008 - 11:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive