Re: [R] drop last character in a names'vector

2010-04-30 Thread Sebastian Kruk
Message- >>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- >>> project.org] On Behalf Of Marc Schwartz >>> Sent: Friday, April 30, 2010 5:04 PM >>> To: Sebastian Kruk >>> Cc: r-help@r-project.org; r-h...@stat.math.ethz.ch >>> Subject:

Re: [R] drop last character in a names'vector

2010-04-30 Thread Marc Schwartz
al Data Center > Intermountain Healthcare > greg.s...@imail.org > 801.408.8111 > > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- >> project.org] On Behalf Of Marc Schwartz >> Sent: Friday, April 30, 2010 5:04 PM >&g

Re: [R] drop last character in a names'vector

2010-04-30 Thread Greg Snow
n...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Marc Schwartz > Sent: Friday, April 30, 2010 5:04 PM > To: Sebastian Kruk > Cc: r-help@r-project.org; r-h...@stat.math.ethz.ch > Subject: Re: [R] drop last character in a names'vector > > > On Apr 30, 201

Re: [R] drop last character in a names'vector

2010-04-30 Thread Marc Schwartz
On Apr 30, 2010, at 5:44 PM, Sebastian Kruk wrote: > Hi, i have a vector filled with names: > > [1] Alvaro Adela ... > [25] Beatriz Berta ... > ... > [10] ... > > I would like to drop last character in every name. > > I use the next program: > > for (i in 1:10) { >

Re: [R] drop last character in a names'vector

2010-04-30 Thread Greg Snow
iginal Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Sebastian Kruk > Sent: Friday, April 30, 2010 4:45 PM > To: r-help@r-project.org; r-h...@stat.math.ethz.ch > Subject: [R] drop last character in a names'vector > >

[R] drop last character in a names'vector

2010-04-30 Thread Sebastian Kruk
Hi, i have a vector filled with names: [1] Alvaro Adela ... [25] Beatriz Berta ... ... [10] ... I would like to drop last character in every name. I use the next program: for (i in 1:10) {                           largo <- nchar(names[i]-1)                           names[i] <- substri