Re: [R] error in density plot

2011-02-03 Thread Ben Bolker
> 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 mis

Re: [R] error in density plot

2011-02-03 Thread David Winsemius
On Feb 3, 2011, at 2:14 PM, Ben Bolker wrote: On 02/02/2011 09:29 AM, David Winsemius wrote: On Feb 2, 2011, at 8:22 AM, Ben Bolker wrote: Ramya gmail.com> writes: I have the code for the density plot j <- 8 plot(density(diff_in_sample[,1]), main = list.files()[j]) for(i in 1:25){ lines(

Re: [R] error in density plot

2011-02-03 Thread Ben Bolker
On 02/02/2011 09:29 AM, David Winsemius wrote: > > On Feb 2, 2011, at 8:22 AM, Ben Bolker wrote: > >> Ramya gmail.com> writes: >> >>> I have the code for the density plot >>> j <- 8 >>> plot(density(diff_in_sample[,1]), main = list.files()[j]) >>> for(i in 1:25){ >>> lines(density(diff_in_sample

Re: [R] error in density plot

2011-02-02 Thread David Winsemius
On Feb 2, 2011, at 8:22 AM, Ben Bolker wrote: Ramya gmail.com> writes: I have the code for the density plot j <- 8 plot(density(diff_in_sample[,1]), main = list.files()[j]) for(i in 1:25){ lines(density(diff_in_sample[,i])) } This gives me an error Error in density.default(diff_in_sample[,

Re: [R] error in density plot

2011-02-02 Thread Ben Bolker
Ramya gmail.com> writes: > I have the code for the density plot > j <- 8 > plot(density(diff_in_sample[,1]), main = list.files()[j]) > for(i in 1:25){ > lines(density(diff_in_sample[,i])) > } > > This gives me an error > Error in density.default(diff_in_sample[, i]) : > 'x' contains missing

[R] error in density plot

2011-02-02 Thread Ramya
Hi, I have the code for the density plot j <- 8 plot(density(diff_in_sample[,1]), main = list.files()[j]) for(i in 1:25){ lines(density(diff_in_sample[,i])) } This gives me an error Error in density.default(diff_in_sample[, i]) : 'x' contains missing values I am not quite sure what to do.