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

From: Dimitris Rizopoulos <dimitris.rizopoulos_at_med.kuleuven.be>
Date: Thu 23 Jun 2005 - 00:53:28 EST

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




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



R-help@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 Received on Thu Jun 23 01:02:27 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:57 EST