Dear R user,

I need plot an histogram for the occurrence of a dataset, and then add a line 
corresponding to the freuqnecy of another similar dataset. in order to do this 
i used the function 
> hist_data1=hist(data1, breaks= seq(0,50,5), plot=FALSE)
> hist_data2=hist(data2, breaks= seq(0,50,5), plot=FALSE)

then I plotted the frequency

> barplot(hist_data1$density)
> lines(hist_data1$density)

but the line is shifted in respect to the center of the bars. how can I 
properly plot the line? another question. this is easy, how can I smooth the 
curve (not fit with loess of spline)?


tnx

--
Claudio

______________________________________________
R-help@stat.math.ethz.ch 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.

Reply via email to