[R] density(x)

Winfried Theis theis at statistik.uni-dortmund.de
Mon Jul 5 17:43:39 CEST 2004


Hello!
On Mon, 2004-07-05 at 15:34, Christoph Hanck wrote:
> Dear experts, 
> 
> when trying to estimate an kernel density function with density(x) I get the following 
> error message with imported data from either EXCEL or text files:
> 
> Error in density(spr) : argument must be numeric.
Well, as R tells you: You should check, whether your data is of type
"numeric". Depending on the way you import the data "spr" this may not
be the case and you have to do 
> density(as.numeric(spr))
which should work... Besides: please read the guidelines for posting
(see http://www.R-project.org/posting-guide.html) giving some details on
the procedure you use to read in the data may have helped to give you a
precise answer!

Regards,

Winfried

-- 
-----------------------------------------------------------------
Dr. Dipl.-Math. Winfried Theis, SFB 475, Projekt C5,
Universität Dortmund, 44221 Dortmund
e-mail: theis at statistik.uni-dortmund.de
Tel.: +49/231/755-5903 FAX: +49/231/755-4387




More information about the R-help mailing list