Re: [R] thousand separator (was RE: weight)

2007-05-01 Thread Peter Dalgaard
Liaw, Andy wrote: Looks very neat, Gabor! I just cannot fathom why anyone who want to write numerics with those separators in a flat file. That's usually not for human consumption, and computers don't need those separators! Andy The world is stranger than you think... (One of my

Re: [R] thousand separator (was RE: weight)

2007-05-01 Thread John Kane
@stat.math.ethz.ch Subject: Re: [R] thousand separator (was RE: weight) Bert, What am I missing? print(as.numeric(gsub(,, , 1,123,456.789)), 10) [1] 1123456.789 FWIW, this is using: R version 2.5.0 Patched (2007-04-27 r41355) Marc On Mon, 2007

[R] thousand separator (was RE: weight)

2007-04-30 Thread Liaw, Andy
I've run into this occasionally. My current solution is simply to read it into Excel, re-format the offending column(s) by unchecking the thousand separator box, and write it back out. Not exactly ideal to say the least. If anyone can provide a better solution in R, I'm all ears... Andy

Re: [R] thousand separator (was RE: weight)

2007-04-30 Thread Marc Schwartz
One possibility would be to use something like the following post-import: WTPP [1] 1,106.8250 1,336.5138 str(WTPP) Factor w/ 2 levels 1,106.8250,1,336.5138: 1 2 as.numeric(gsub(,, , WTPP)) [1] 1106.825 1336.514 Essentially strip the ',' characters from the factors and then coerce the

Re: [R] thousand separator (was RE: weight)

2007-04-30 Thread Bert Gunter
@stat.math.ethz.ch Subject: Re: [R] thousand separator (was RE: weight) One possibility would be to use something like the following post-import: WTPP [1] 1,106.8250 1,336.5138 str(WTPP) Factor w/ 2 levels 1,106.8250,1,336.5138: 1 2 as.numeric(gsub(,, , WTPP)) [1] 1106.825 1336.514 Essentially strip

Re: [R] thousand separator (was RE: weight)

2007-04-30 Thread Marc Schwartz
Bert Gunter Genentech Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc Schwartz Sent: Monday, April 30, 2007 10:02 AM To: Liaw, Andy Cc: r-help@stat.math.ethz.ch Subject: Re: [R] thousand separator (was RE: weight

[R] thousand separator (was RE: weight)

2007-04-30 Thread Natalie O'Toole
Thank-you Andy!! That works great now Nat __ I've run into this occasionally. My current solution is simply to read it into Excel, re-format the offending column(s) by unchecking the thousand separator box, and write it back out. Not exactly ideal to say the least. If

Re: [R] thousand separator (was RE: weight)

2007-04-30 Thread Bert Gunter
-help@stat.math.ethz.ch Subject: Re: [R] thousand separator (was RE: weight) Bert, What am I missing? print(as.numeric(gsub(,, , 1,123,456.789)), 10) [1] 1123456.789 FWIW, this is using: R version 2.5.0 Patched (2007-04-27 r41355) Marc On Mon, 2007-04-30 at 10:13 -0700, Bert Gunter wrote

Re: [R] thousand separator (was RE: weight)

2007-04-30 Thread Liaw, Andy
Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc Schwartz Sent: Monday, April 30, 2007 10:18 AM To: Bert Gunter Cc: r-help@stat.math.ethz.ch Subject: Re: [R] thousand separator (was RE: weight) Bert, What am I

Re: [R] thousand separator (was RE: weight)

2007-04-30 Thread Gabor Grothendieck
-help@stat.math.ethz.ch Subject: Re: [R] thousand separator (was RE: weight) Bert, What am I missing? print(as.numeric(gsub(,, , 1,123,456.789)), 10) [1] 1123456.789 FWIW, this is using: R version 2.5.0 Patched (2007-04-27 r41355) Marc On Mon, 2007-04-30 at 10:13 -0700

Re: [R] thousand separator (was RE: weight)

2007-04-30 Thread Liaw, Andy
@stat.math.ethz.ch Subject: Re: [R] thousand separator (was RE: weight) Bert, What am I missing? print(as.numeric(gsub(,, , 1,123,456.789)), 10) [1] 1123456.789 FWIW, this is using: R version 2.5.0 Patched (2007-04-27 r41355) Marc On Mon, 2007-04-30