Re: [R] substr gives empty output

2018-01-23 Thread Luigi Marongiu
bstr(x, i, i) > > and you should get what you want. > Cheers, > Tim > > > Date: Sun, 21 Jan 2018 10:50:31 -0500 > > From: Ek Esawi <esaw...@gmail.com> > > To: Luigi Marongiu <marongiu.lu...@gmail.com>, r-help@r-project.org > > Subject: Re: [R] su

Re: [R] substr gives empty output

2018-01-22 Thread David L Carlson
" "t" "i" "n" "g" David L Carlson Department of Anthropology Texas A University College Station, TX 77843-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Howa

Re: [R] substr gives empty output

2018-01-22 Thread Howard, Tim G (DEC)
t; To: Luigi Marongiu <marongiu.lu...@gmail.com>, r-help@r-project.org > Subject: Re: [R] substr gives empty output > Message-ID: > <CA+ZkTxubYDSZ3iqsg_=be9HBA2_3-TE95=mXbh4atvG- > ri_...@mail.gmail.com> > Content-Type: text/plain; charset="UTF-8" > &

Re: [R] substr gives empty output

2018-01-21 Thread Ek Esawi
The reason you get "" is, as stated on the previous response and on the documentation of substr function, the function "When extracting, if start is larger than the string length then "" is returned.". This is what happens on your function. HTH EK On Sun, Jan 21, 2018 at 3:59 AM, Luigi Marongiu

Re: [R] substr gives empty output

2018-01-21 Thread Ted Harding
On Sun, 2018-01-21 at 09:59 +0100, Luigi Marongiu wrote: > Dear all, > I have a string, let's say "testing", and I would like to extract in > sequence each letter (character) from it. But when I use substr() I only > properly get the first character, the rest is empty (""). What am I getting >

[R] substr gives empty output

2018-01-21 Thread Luigi Marongiu
Dear all, I have a string, let's say "testing", and I would like to extract in sequence each letter (character) from it. But when I use substr() I only properly get the first character, the rest is empty (""). What am I getting wrong? For example, I have this code: >>> x <- "testing" k <-