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 mo

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 programm

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 l

Re: [R] string-to-number SUMMARY

2006-08-19 Thread Gabor Grothendieck
s to all. > > > Charles Annis, P.E. > > [EMAIL PROTECTED] > phone: 561-352-9699 > eFax: 614-455-3265 > http://www.StatisticalEngineering.com > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Charles Annis, P.E. >

Re: [R] string-to-number SUMMARY

2006-08-19 Thread Charles Annis, P.E.
[EMAIL PROTECTED] On Behalf Of Charles Annis, P.E. 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

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.measu

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 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 o

Re: [R] string-to-number

2006-08-19 Thread Peter Dalgaard
"Charles Annis, P.E." <[EMAIL PROTECTED]> writes: > 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

Re: [R] string-to-number

2006-08-19 Thread Marc Schwartz
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. > > as.numeric(repeated.measures.columns) doesn't work (lik

[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 I

Re: [R] string to number conversion

2003-01-29 Thread Douglas Bates
Serge Boiko <[EMAIL PROTECTED]> writes: > Hi there; > In order to convert sting to number I do: > s <- "22" > mode(s) <- "integer" # "double", etc. will do > > Is that a "preferred" way? Coersion functions are preferred. > as.integer("22") [1] 22 > as.numeric("22") [1] 22 If you have the metho

[R] string to number conversion

2003-01-29 Thread Serge Boiko
Hi there; In order to convert sting to number I do: s <- "22" mode(s) <- "integer" # "double", etc. will do Is that a "preferred" way? Many thanks. -Serge __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help