Re: [R] remove leading slash

2012-06-15 Thread Spencer Graves
gt;> >> ** ** >> >> Bill Dunlap**** >> >> Spotfire, TIBCO Software >> >> wdunlap tibco.com >> >> ** ** >> >> *From:* Ben quant [mailto:ccqu...@gmail.com] >> *Sent:* Friday, June 08, 2012 11:40 AM >> *To:* Willi

Re: [R] remove leading slash

2012-06-08 Thread Ben quant
t [mailto:ccqu...@gmail.com] > *Sent:* Friday, June 08, 2012 11:40 AM > *To:* William Dunlap > > *Cc:* r-help@r-project.org > *Subject:* Re: [R] remove leading slash > > ** ** > > Okay, Bill smelt something wrong, so I must revise. > > This works for large num

Re: [R] remove leading slash

2012-06-08 Thread William Dunlap
ill Dunlap Spotfire, TIBCO Software wdunlap tibco.com From: Ben quant [mailto:ccqu...@gmail.com] Sent: Friday, June 08, 2012 11:40 AM To: William Dunlap Cc: r-help@r-project.org Subject: Re: [R] remove leading slash Okay, Bill smelt something wrong, so I must revise. This works for large numb

Re: [R] remove leading slash

2012-06-08 Thread Ben quant
bco.com > > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf > > Of Ben quant > > Sent: Friday, June 08, 2012 11:00 AM > > To: Duncan Murdoch > > Cc: r-help@r-project.org > > S

Re: [R] remove leading slash

2012-06-08 Thread William Dunlap
..@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Ben quant > Sent: Friday, June 08, 2012 11:00 AM > To: Duncan Murdoch > Cc: r-help@r-project.org > Subject: Re: [R] remove leading slash > > Thanks for all your help. I did it this way: > > >

Re: [R] remove leading slash

2012-06-08 Thread Ben quant
Thanks for all your help. I did it this way: > x = sapply(cnt_str,deparse) > x \002\001\002 "\"\\002\"" "\"\\001\"" "\"\\102\"" > as.numeric(substr(x,3,5)) [1] 2 1 102 ...which is a bit of a hack, but gets me where I want to go. Thanks, Ben On Fri, Jun 8, 2012 at 11:

Re: [R] remove leading slash

2012-06-08 Thread Duncan Murdoch
On 08/06/2012 1:50 PM, Peter Langfelder wrote: On Fri, Jun 8, 2012 at 10:25 AM, David Winsemius wrote: > > On Jun 8, 2012, at 1:11 PM, Ben quant wrote: > >> Hello, >> >> How do I change this: >>> >>> cnt_str >> >> [1] "\002" "\001" "\102" >> >> ...to this: >>> >>> cnt_str >> >> [1] "2" "

Re: [R] remove leading slash

2012-06-08 Thread peter dalgaard
On Jun 8, 2012, at 19:25 , David Winsemius wrote: > > On Jun 8, 2012, at 1:11 PM, Ben quant wrote: > >> Hello, >> >> How do I change this: >>> cnt_str >> [1] "\002" "\001" "\102" >> >> ...to this: >>> cnt_str >> [1] "2" "1" "102" >> >> Having trouble because of this: >>> nchar(cnt_str[1]) >>

Re: [R] remove leading slash

2012-06-08 Thread Peter Langfelder
On Fri, Jun 8, 2012 at 10:25 AM, David Winsemius wrote: > > On Jun 8, 2012, at 1:11 PM, Ben quant wrote: > >> Hello, >> >> How do I change this: >>> >>> cnt_str >> >> [1] "\002" "\001" "\102" >> >> ...to this: >>> >>> cnt_str >> >> [1] "2" "1" "102" >> >> Having trouble because of this: >>> >>> nc

Re: [R] remove leading slash

2012-06-08 Thread David Winsemius
On Jun 8, 2012, at 1:11 PM, Ben quant wrote: Hello, How do I change this: cnt_str [1] "\002" "\001" "\102" ...to this: cnt_str [1] "2" "1" "102" Having trouble because of this: nchar(cnt_str[1]) [1] 1 "\001" is ASCII cntrl-A, a single character. ?Quotes # not the first, second or

[R] remove leading slash

2012-06-08 Thread Ben quant
Hello, How do I change this: > cnt_str [1] "\002" "\001" "\102" ...to this: > cnt_str [1] "2" "1" "102" Having trouble because of this: > nchar(cnt_str[1]) [1] 1 Thanks! Ben [[alternative HTML version deleted]] __ R-help@r-project.org maili