Re: [R] vector fragment

2009-05-16 Thread Jorge Ivan Velez
Dear Jonas, Try this: > v<- c('stratosphere', 'mesosphere', 'troposphere') > substr(v,3,4) [1] "ra" "so" "op" See ?substr for more information. HTH, Jorge On Sat, May 16, 2009 at 9:52 AM, jonas garcia wrote: > Dear R users: > > > > I have got a simple question that has been bothering me for

[R] vector fragment

2009-05-16 Thread jonas garcia
Dear R users: I have got a simple question that has been bothering me for a while. Given a certain character vector, I would like to get in a separate vector a fragment of text, in this case the 3rd and 4th letters of each element. So, if: v<- c(“stratosphere”, “mesosphere”, “troposphere”