Re: [R] about string

From: Jacques VESLOT <jacques.veslot_at_good.ibl.fr>
Date: Tue 06 Jun 2006 - 18:27:17 EST

?nchar
sapply(strsplit("f:\\JPCS_signal.txt", "_"), function(x) substring(x[1], 4))



Jacques VESLOT

CNRS UMR 8090
I.B.L (2ème étage)
1 rue du Professeur Calmette
B.P. 245
59019 Lille Cedex

Tel : 33 (0)3.20.87.10.44
Fax : 33 (0)3.20.87.10.31

http://www-good.ibl.fr


XinMeng a écrit :
> Hello sir:
> There are 2 questions about string.
> 1 How to calculate the width of a string? e.g string "abc"'s width is 3;
> 2 How can I get the "substring" in such kind of condition:
> "f:\\JPCS_signal.txt" "f:\\PC1_signal.txt" "f:\\PC2_signal.txt"
> What I wanna get is "JPCS" "PC1" "PC2".How can I achieve them by R cammand?
>
> Thanks a lot!
>
> My best
>
>
>
>
> ------------------------------
> *******************************************
> Xin Meng
> Capitalbio Corporation
> National Engineering Research Center
> for Beijing Biochip Technology
> BioPharma-informatics & Software Dept.
> Research Engineer
> Tel: +86-10-80715888/80726868-6438
> Fax: +86-10-80726790
> Email£ºxmeng@capitalbio.com
> Address:18 Life Science Parkway,
> Changping District, Beijing 102206, China
>
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> 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 Tue Jun 06 18:30:18 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 06 Jun 2006 - 20:10:33 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.