[R] drop a letter

2007-05-16 Thread elyakhlifi mustapha
hello, how can I do to drop C from this character C325 ? _ [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list

Re: [R] drop a letter

2007-05-16 Thread Chuck Cleland
elyakhlifi mustapha wrote: hello, how can I do to drop C from this character C325 ? x - C325 substring(x, first=2) [1] 325 gsub(C, , x) [1] 325 gsub([A-Z], , x) [1] 325 ?substring ?gsub _

Re: [R] drop a letter

2007-05-16 Thread Vladimir Eremeev
elyakhlifi mustapha wrote: hello, how can I do to drop C from this character C325 ? 1. if C is always single and always first: substring(C325,2) 2. more generic solution, drops all letters sp-unlist(strsplit(C325,split=[A-Z])) sp-sp[nchar(sp)0] sp -- View this message in context: