[R] error in density plot

Ben Bolker bbolker at gmail.com
Thu Feb 3 21:01:41 CET 2011


> My concern was that it was "outside" the density function and I thought
> the density function would throw an error before it passed anything to
> na.omit().
> 
> plot(na.omit(density(c(1,1,1,1,1,NA,4,4,4,4)))  )
> Error in density.default(c(1, 1, 1, 1, 1, NA, 4, 4, 4, 4)) :
>   'x' contains missing values
> 
> plot(density(na.omit(c(1,1,1,1,1,NA,4,4,4,4))) )  # "works"
> 
> 
>>
>> Ben
>>
>>
> 
> David Winsemius, MD
> West Hartford, CT
> 

  of course.  sorry about that.



More information about the R-help mailing list