[R] Is it possible to get the first letter of a word?

Dimitris Rizopoulos dimitris.rizopoulos at med.kuleuven.be
Wed Jun 22 16:53:28 CEST 2005


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" <navarre_sabine at yahoo.fr>
To: <r-help at stat.math.ethz.ch>
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]]
>
>


--------------------------------------------------------------------------------


> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list