[R] gregexpr() - length of the matched text to a vector

2006-01-11 Thread Petri Palmu
Hi, I'm using gregexpr(). As a result something like this: # starting positions of the match: [[1]] [1] 7 18 # length of the matched text: attr(,match.length) [1] 4 4 Now, I'd like to have a matrix, 74 18 4 but I don't know how to handle the attr(,match.length) ...? The format of

Re: [R] gregexpr() - length of the matched text to a vector

2006-01-11 Thread Petri Palmu
Now I found a solution that seems to work OK for me: attributes(gregexpr(expression, text)[[1]]) Petri At 15:00 11.1.2006 +0100, Petri Palmu wrote: Hi, I'm using gregexpr(). As a result something like this: # starting positions of the match: [[1]] [1] 7 18 # length of the matched text:

Re: [R] gregexpr() - length of the matched text to a vector

2006-01-11 Thread Ben Bolker
Petri Palmu petri.palmu at geneos.fi writes: I'm using gregexpr(). As a result something like this: # starting positions of the match: [[1]] [1] 7 18 # length of the matched text: attr(,match.length) [1] 4 4 Now, I'd like to have a matrix, 74 18 4 something like x1

Re: [R] gregexpr() - length of the matched text to a vector

2006-01-11 Thread Seth Falcon
Hi Petri, On 11 Jan 2006, [EMAIL PROTECTED] wrote: I'm using gregexpr(). As a result something like this: # starting positions of the match: [[1]] [1] 7 18 # length of the matched text: attr(,match.length) [1] 4 4 Now, I'd like to have a matrix, 74 18 4 but I don't know how