Re: [R] remove commas in a number when reading a text file

2011-06-14 Thread Greg Snow
Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Lee, Eric > Sent: Monday, June 13, 2011 9:49 AM > To: r-help@R-project.org > Subject: [R] remove commas in a number w

Re: [R] remove commas in a number when reading a text file

2011-06-13 Thread Lee, Eric
number when reading a text file On Mon, Jun 13, 2011 at 8:48 AM, Lee, Eric wrote: > Hello, > > I'm running version R x64 v2.12.2 on a 64bit windows 7 PC.  I'm trying to > read a text file using read.table where the values have a format like > "1,234,567".  Wh

Re: [R] remove commas in a number when reading a text file

2011-06-13 Thread Peter Langfelder
On Mon, Jun 13, 2011 at 8:48 AM, Lee, Eric wrote: > Hello, > > I'm running version R x64 v2.12.2 on a 64bit windows 7 PC.  I'm trying to > read a text file using read.table where the values have a format like > "1,234,567".  What I want is "1234567".  Is there a quick way to strip out > the com

Re: [R] remove commas in a number when reading a text file

2011-06-13 Thread Peter Alspach
Tena koe Eric ?sub and ?gsub HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Lee, Eric > Sent: Tuesday, 14 June 2011 3:49 a.m. > To: r-help@R-project.org > Subject: [R] remove comma

Re: [R] remove commas in a number when reading a text file

2011-06-13 Thread Joshua Wiley
Hi Eric, Try this: gsub(",", "", "1,234,567", fixed = TRUE) Cheers, Josh On Mon, Jun 13, 2011 at 8:48 AM, Lee, Eric wrote: > Hello, > > I'm running version R x64 v2.12.2 on a 64bit windows 7 PC.  I'm trying to > read a text file using read.table where the values have a format like > "1,234,

[R] remove commas in a number when reading a text file

2011-06-13 Thread Lee, Eric
Hello, I'm running version R x64 v2.12.2 on a 64bit windows 7 PC. I'm trying to read a text file using read.table where the values have a format like "1,234,567". What I want is "1234567". Is there a quick way to strip out the commas? I can use strsplit and paste, but the file is quite larg