Hi,

I have a vector of strings (class character) with 6 elements (length  
6). I call it 'names'.

"Graham Chapman"
"John Cleese"
"Terry Gilliam"
"Eric Idle"
"Terry Jones"
"Michael Palin"

And I want to turn it into another vector of strings called  
'shortnames' with the same length.
The new vector should look like:

"Gra Cha"
"Joh Cle"
"Ter Gil"
"Eri Idl"
"Ter Jon"
"Mic Pal"

I just want to clip the first three characters of each word inside  
each string.

Would anyone know how to do this quickly?

Thanks!

Gonçalo





        [[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