[R] Quick Question about R

2007-01-31 Thread Konrad
Hello, Is there a way to convert a character to a number with out getting a warning? I have a vector that has both numbers and letters in it and I need to convert it to only numbers. At the moment I'm using as.numeric but it is generating a warning when it converts a letter. Is there another

Re: [R] Quick Question about R

2007-01-31 Thread Benilton Carvalho
suppressWarnings(a - as.numeric(c(1, 2, pi, a, 9, z))) b On Jan 31, 2007, at 2:35 PM, Konrad wrote: Hello, Is there a way to convert a character to a number with out getting a warning? I have a vector that has both numbers and letters in it and I need to convert it to only numbers. At

Re: [R] Quick Question about R

2007-01-31 Thread Chuck Cleland
Konrad wrote: Hello, Is there a way to convert a character to a number with out getting a warning? I have a vector that has both numbers and letters in it and I need to convert it to only numbers. At the moment I'm using as.numeric but it is generating a warning when it converts a

Re: [R] Quick Question about R

2007-01-31 Thread Marc Schwartz
On Wed, 2007-01-31 at 14:35 -0500, Konrad wrote: Hello, Is there a way to convert a character to a number with out getting a warning? I have a vector that has both numbers and letters in it and I need to convert it to only numbers. At the moment I'm using as.numeric but it is generating a

Re: [R] Quick Question about R

2007-01-31 Thread Ted Harding
On 31-Jan-07 Konrad wrote: Hello, Is there a way to convert a character to a number with out getting a warning? I have a vector that has both numbers and letters in it and I need to convert it to only numbers. At the moment I'm using as.numeric but it is generating a warning when it

Re: [R] Quick Question about R

2007-01-31 Thread Ted Harding
On 31-Jan-07 Benilton Carvalho wrote: suppressWarnings(a - as.numeric(c(1, 2, pi, a, 9, z))) Of course! Much better! Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 31-Jan-07

Re: [R] Quick Question about R

2007-01-31 Thread Marc Schwartz
On Wed, 2007-01-31 at 20:02 +, [EMAIL PROTECTED] wrote: On 31-Jan-07 Benilton Carvalho wrote: suppressWarnings(a - as.numeric(c(1, 2, pi, a, 9, z))) Of course! Much better! Ted. In the context of my prior reply: # Bear in mind that the above vector is of class character, not mixed...