On Mon, 2004-07-05 at 08: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.
> 
> Other procedues such as truehist work. If I generate data within R density works 
> fine. 
> Does anybody have an idea?


More than likely, your vector 'spr' was imported as a factor. This would
possibly suggest that at least one value in 'spr' is not numeric. If the
entire vector was numeric, this would not be a problem.

It is also possible that you may have not specified the proper
delimiting character during the import, which would compromise the
parsed structure of the incoming data.

Use:

str(spr)

and you will probably get 

Factor ...

First, check to be sure that you have used the proper delimiting
character during your import. See ?read.table for the family of related
functions and the default argument values for 'sep', which is the
delimiting character.

You should also check your source data file, since it may be
problematic.

HTH,

Marc Schwartz

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to