[R] Vector of string

Sandor Benczik sandor.benczik at crabel.ro
Tue Jun 23 17:36:22 CEST 2009




njhuang86 wrote:
> 
> Hi all. Suppose I have a vector of strings ie: ["12384", "AVC_TYU123123", 
> "ESPN_TYU", "TYU_TYU", "AVC3939", "hhr1919", "TYU0029"]
> 
> Is there an efficient method that would allow me to return a vector of the
> position of strings that start with "TYU"? So essentially, I would like to
> get back in return [4, 7]. Anyways, any help with be greatly appreciated!
> 

?grep

The pattern  is  "^TYU" with perl=T, if I am not mistaken.

-- 
View this message in context: http://www.nabble.com/Vector-of-string-tp24167271p24167332.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list