Re: [R] string-to-number

2006-08-21 Thread Mike Nielsen
Marc, Thanks very much for this. I hadn't really looked at Rprof in the past; now I have a new toy to play with! I have formulated an hypothesis that the reason parse/eval is quicker lies in the pattern-matching code: strsplit is using regular expressions, whereas perhaps parse is using some

Re: [R] string-to-number

2006-08-20 Thread Marc Schwartz
On Sat, 2006-08-19 at 10:25 -0600, Mike Nielsen wrote: Wow. New respect for parse/eval. Do you think this is a special case of a more general principle? I suppose the cost is memory, but from time to time a speedup like this would be very beneficial. Any hints about how R programmers

[R] string-to-number

2006-08-19 Thread Charles Annis, P.E.
Greetings, Amigos: I have been trying without success to convert a character string, repeated.measures.columns [1] 3,6,10 into c(3,6,10) for subsequent use. as.numeric(repeated.measures.columns) doesn't work (likely because of the commas) [1] NA Warning message: NAs introduced by coercion

Re: [R] string-to-number

2006-08-19 Thread Roger Bivand
On Sat, 19 Aug 2006, Charles Annis, P.E. wrote: Greetings, Amigos: I have been trying without success to convert a character string, repeated.measures.columns [1] 3,6,10 into c(3,6,10) for subsequent use. as.numeric(repeated.measures.columns) doesn't work (likely because of the

Re: [R] string-to-number

2006-08-19 Thread Prof Brian Ripley
On Sat, 19 Aug 2006, Marc Schwartz wrote: On Sat, 2006-08-19 at 07:58 -0400, Charles Annis, P.E. wrote: Greetings, Amigos: I have been trying without success to convert a character string, repeated.measures.columns [1] 3,6,10 into c(3,6,10) for subsequent use.

Re: [R] string-to-number

2006-08-19 Thread Marc Schwartz
On Sat, 2006-08-19 at 13:30 +0100, Prof Brian Ripley wrote: On Sat, 19 Aug 2006, Marc Schwartz wrote: On Sat, 2006-08-19 at 07:58 -0400, Charles Annis, P.E. wrote: Greetings, Amigos: I have been trying without success to convert a character string, repeated.measures.columns

Re: [R] string-to-number SUMMARY

2006-08-19 Thread Charles Annis, P.E.
, August 19, 2006 7:59 AM To: r-help@stat.math.ethz.ch Subject: [R] string-to-number Greetings, Amigos: I have been trying without success to convert a character string, repeated.measures.columns [1] 3,6,10 into c(3,6,10) for subsequent use. as.numeric(repeated.measures.columns) doesn't work (likely

Re: [R] string-to-number SUMMARY

2006-08-19 Thread Gabor Grothendieck
. Sent: Saturday, August 19, 2006 7:59 AM To: r-help@stat.math.ethz.ch Subject: [R] string-to-number Greetings, Amigos: I have been trying without success to convert a character string, repeated.measures.columns [1] 3,6,10 into c(3,6,10) for subsequent use. as.numeric

Re: [R] string-to-number

2006-08-19 Thread Mike Nielsen
Wow. New respect for parse/eval. Do you think this is a special case of a more general principle? I suppose the cost is memory, but from time to time a speedup like this would be very beneficial. Any hints about how R programmers could recognize such cases would, I am sure, be of value to the