[R] length of a string

Bill.Venables at csiro.au Bill.Venables at csiro.au
Wed Sep 5 15:58:29 CEST 2007


sLengths <- with(dataFrame, nchar(as.character(SEQUENCE))) 


Bill Venables
CSIRO Laboratories
PO Box 120, Cleveland, 4163
AUSTRALIA
Office Phone (email preferred): +61 7 3826 7251
Fax (if absolutely necessary):  +61 7 3826 7304
Mobile:                         +61 4 8819 4402
Home Phone:                     +61 7 3286 7700
mailto:Bill.Venables at csiro.au
http://www.cmis.csiro.au/bill.venables/ 

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of João Fadista
Sent: Wednesday, 5 September 2007 11:51 PM
To: r-help at stat.math.ethz.ch
Subject: [R] length of a string

Dear all,
 
I would like to know how can I compute the length of a string in a dataframe. Example:
 
SEQUENCE                               ID
TGCTCCCATCTCCACGG            HR04FS000000645
ACTGAACTCCCATCTCCAAT      HR00000595847847
 
I would like to know how to compute the length of each SEQUENCE.
 

Best regards,
João Fadista

	[[alternative HTML version deleted]]



More information about the R-help mailing list