An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20131209/c6232026/attachment.pl>
Plot mortality data and show trend
2 messages · Norbi Gurracho, Jim Lemon
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