On 12/10/2013 07:53 AM, Norbi Gurracho wrote:
I have a mortality data over many years  and I wish to plot the data and also add some 
smoother to clearly highlight the trend. How could I do that in R with base graphics or 
ggplot? I have the following sample data: require(lubridate) 
mdate<-seq(ymd('2000-01-01'),ymd('2010-12-31'), by = '1 day') death<- rnorm(4018, 
80, 45) df<-cbind(mdate,death)                                   

Hi Norbi,
One way is:

plot(mdate,death,type="l",col="lightgray")
lines(supsmu(mdate,death))

Jim

______________________________________________
R-help@r-project.org 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