Ramya <ramya.victory <at> 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 values
[snip]
?NA
lines(na.omit(density(diff_in_sample[,i])))
Consider replacing the loop by apply() [no efficiency
gain, but more compact code]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.