[R] character to numeric conversion

2007-03-19 Thread Robin Hankin
Hi. Is there a straightforward way to convert a character string containing comma-delimited numbers to a numeric vector? In my application, I use system(executable.string, intern=TRUE) which returns a string like [0.E-38, 2.096751179214927596171268230, 3.678944959657480671183123052,

Re: [R] character to numeric conversion

2007-03-19 Thread Dimitris Rizopoulos
/~m0390867/dimitris.htm - Original Message - From: Robin Hankin [EMAIL PROTECTED] To: RHelp help r-help@stat.math.ethz.ch Sent: Monday, March 19, 2007 10:18 AM Subject: [R] character to numeric conversion Hi. Is there a straightforward way to convert a character string containing comma

Re: [R] character to numeric conversion

2007-03-19 Thread Peter Dalgaard
Robin Hankin wrote: Hi. Is there a straightforward way to convert a character string containing comma-delimited numbers to a numeric vector? In my application, I use system(executable.string, intern=TRUE) which returns a string like [0.E-38, 2.096751179214927596171268230,

Re: [R] character to numeric conversion

2007-03-19 Thread Robin Hankin
Hello everybody thanks for the tips. I *think* this should be the same thread The manpage for system() says that lines of over 8095 characters will be split. This is causing me problems. How do I get round the 8095 character limit? Simple toy example follows: jj - system(echo 4 | awk

Re: [R] character to numeric conversion

2007-03-19 Thread Robin Hankin
On 19 Mar 2007, at 11:20, Robin Hankin wrote: Hello everybody thanks for the tips. I *think* this should be the same thread The manpage for system() says that lines of over 8095 characters will be split. This is causing me problems. How do I get round the 8095 character limit?

Re: [R] character to numeric conversion

2007-03-19 Thread Roger Bivand
On Mon, 19 Mar 2007, Robin Hankin wrote: Hello everybody thanks for the tips. I *think* this should be the same thread The manpage for system() says that lines of over 8095 characters will be split. This is causing me problems. How do I get round the 8095 character limit?

Re: [R] character to numeric conversion

2007-03-19 Thread Gabor Grothendieck
Here is one way. This matches strings which contain those characters found in a number, converting each such string to numeric. library(gsubfn) strapply(x, [-0-9+.E]+, as.numeric) On 3/19/07, Robin Hankin [EMAIL PROTECTED] wrote: Hi. Is there a straightforward way to convert a character

Re: [R] character to numeric conversion

2007-03-19 Thread Greg Snow
Dalgaard Cc: RHelp help; Robin Hankin Subject: Re: [R] character to numeric conversion Hello everybody thanks for the tips. I *think* this should be the same thread The manpage for system() says that lines of over 8095 characters will be split. This is causing me problems. How