Re: [R] sub / gsub - extracting between identical symbols

From: Daniel Malter <daniel_at_umd.edu>
Date: Thu, 20 Nov 2008 12:32:09 -0500


Thanks.  

Daniel  



cuncta stricte discussurus
 

Von: Henrique Dallazuanna [mailto:wwwhsd_at_gmail.com] Gesendet: Thursday, November 20, 2008 5:18 AM An: Daniel Malter
Cc: r-help_at_stat.math.ethz.ch
Betreff: Re: [R] sub / gsub - extracting between identical symbols

Try this:

unlist(strsplit("12/01/03/08", "/"))

On Thu, Nov 20, 2008 at 6:08 AM, Daniel Malter <daniel_at_umd.edu> wrote:

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.
-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O


	[[alternative HTML version deleted]]


______________________________________________ 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 - 17:50:47 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 - 18:30:26 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