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”)



I want to obtain a different vector like this:



c(“ra”, “so”, “op”)



Thanks in advance for your help



Jonas

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to