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

Petri Palmu petri.palmu at geneos.fi
Wed Jan 11 15:00:27 CET 2006



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,
  7    4
18   4

but I don't know how to handle the attr(,"match.length") ...?
The format of the output is pretty unclear to me in that respect.

Thanks in advance,
Petri
----------------------
Petri Palmu, M.Soc.Sc
Statistician
petri.palmu at geneos.fi

Geneos Ltd
tel:+358 9 4366 2512
gsm: +35840 55 249 55
fax:+ 358 9 4366 2523
P.O. Box 25 (Tukholmankatu 2)
FIN-00251, Helsinki, Finland




More information about the R-help mailing list