Re: [R] Simple numeric "as.is" question

2004-03-15 Thread Prof Brian Ripley
On Mon, 15 Mar 2004, Tom Blackwell wrote: > Try x2 <- as.numeric(as.character(x)) > hist(x2) > > I'm not a Windows user, so I can't test this before sending. > It might solve the problem, might not. > > (Flame !! : This is just ONE MORE example of the difficulties > caused by the default

RE: [R] Simple numeric "as.is" question

2004-03-15 Thread Prof Brian Ripley
On Mon, 15 Mar 2004, Andy Bunn wrote: > Look at the help for: > ?as.numeric and make sure you read there that it is the wrong thing (as a column of a data frame will be a factor). Better to look this up in the FAQ! > HTH, Andy > > -Original Message- > > From: [EMAIL PROTECTED] > > [mai

RE: [R] Simple numeric "as.is" question

2004-03-15 Thread Liaw, Andy
> From: Peter Dalgaard > Sent: Monday, March 15, 2004 3:51 PM > To: Timur Elzhov > Cc: [EMAIL PROTECTED]; Janet Gannon > Subject: Re: [R] Simple numeric "as.is" question > > > Timur Elzhov <[EMAIL PROTECTED]> writes: > > > On Mon, Mar

Re: [R] Simple numeric "as.is" question

2004-03-15 Thread Uwe Ligges
Janet Gannon wrote: I am reading a list of numbers from my clipboard, and have been successful, except I can't make a histogram as R doesn't recognize my variable as numeric. I know I need to use "as.is", but the specifics escape me. I have used x<-read.table("clipboard", header=F) to import f

Re: [R] Simple numeric "as.is" question

2004-03-15 Thread Thomas Petzoldt
Janet Gannon wrote: I am reading a list of numbers from my clipboard, and have been successful, except I can't make a histogram as R doesn't recognize my variable as numeric. I know I need to use "as.is", but the specifics escape me. I have used x<-read.table("clipboard", header=F) to import f

Re: [R] Simple numeric "as.is" question

2004-03-15 Thread Peter Dalgaard
Timur Elzhov <[EMAIL PROTECTED]> writes: > On Mon, Mar 15, 2004 at 09:04:05AM -0500, Janet Gannon wrote: > > > I am reading a list of numbers from my clipboard, and have been > > successful, except I can't make a histogram as R doesn't recognize my > > variable as numeric. I know I need to use

Re: [R] Simple numeric "as.is" question

2004-03-15 Thread Timur Elzhov
On Mon, Mar 15, 2004 at 09:04:05AM -0500, Janet Gannon wrote: > I am reading a list of numbers from my clipboard, and have been > successful, except I can't make a histogram as R doesn't recognize my > variable as numeric. I know I need to use "as.is", but the specifics > escape me. > > I ha

Re: [R] Simple numeric "as.is" question

2004-03-15 Thread Sundar Dorai-Raj
Janet Gannon wrote: I am reading a list of numbers from my clipboard, and have been successful, except I can't make a histogram as R doesn't recognize my variable as numeric. I know I need to use "as.is", but the specifics escape me. I have used x<-read.table("clipboard", header=F) to import

Re: [R] Simple numeric "as.is" question

2004-03-15 Thread Tom Blackwell
Janet - Try x2 <- as.numeric(as.character(x)) hist(x2) I'm not a Windows user, so I can't test this before sending. It might solve the problem, might not. (Flame !! : This is just ONE MORE example of the difficulties caused by the default behavior of read.table() to make things into fa

RE: [R] Simple numeric "as.is" question

2004-03-15 Thread Andy Bunn
Look at the help for: ?as.numeric HTH, Andy > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Janet Gannon > Sent: Monday, March 15, 2004 7:04 AM > To: [EMAIL PROTECTED] > Subject: [R] Simple numeric "as.is" question > > > I am reading a list of numb

RE: [R] Simple numeric "as.is" question

2004-03-15 Thread Liaw, Andy
If read.table() is not recognizing the data as numeric, there's probably something in the content that confused read.table(). You can try using x <- scan("clipboard") instead and see if and how it chokes. Andy > From: Janet Gannon > > I am reading a list of numbers from my clipboard, and ha