Skip to content
Back to formatted view

Raw Message

Message-ID: <39B6DDB9048D0F4DAD42CB26AAFF0AFA076D5C@usctmx1106.merck.com>
Date: 2005-04-06T15:25:41Z
From: Liaw, Andy
Subject: Error in hist.default(A) : `x' must be numeric

> From: Uwe Ligges
> 
> Mag. Ferri Leberl wrote:
> > Dear everybody!
> > I have load a list A of numbers and want a histogram to be drawn.
> > on
> > hist(Y)
> > the Machine returns:
> > Error in hist.default(A) : `x' must be numeric
> > I found out, that the list is of type data.frame.
> > Y<-as.numeric(Y)
> > returns
> > Error in as.double.default(A) : (list) object cannot be 
> coerced to double
> > What schould I do?
> > Than you in advance!
> 
> Extract the relevant vector from your data frame Y (this is a very 
> prbably guess).

I suspect Ferri might have the numbers in one line in a file, and read them
into R with read.table().  That would put the numbers into a data frame with
n variables and one observation.  If that's the case, just replacing
read.table() with scan() should do it.

Andy

 
> Uwe Ligges
>