you could use substr(), e.g.,
x <- c("asf", "dfds", "fdfdf dfd", "ehf rf ngfjvf", "gfg ")
substr(x, 1, 1)
I hope it helps.
Best,
Dimitris
----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.be/biostat/
http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm
----- Original Message -----
From: "Navarre Sabine" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, June 22, 2005 4:42 PM
Subject: [R] Is it possible to get the first letter of a word?
> Hi,
> I would to get the first letter of a word like:
>
>> title_cat
> TitleCat
> 1 Training
>
> I would like T from Training!
>
> Thnaks a lot for your help
>
> Sabine
>
>
> ---------------------------------
>
> Téléchargez le ici !
> [[alternative HTML version deleted]]
>
>
--------------------------------------------------------------------------------
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html