[R] Time Series - Trend Line
R. Michael Weylandt
michael.weylandt at gmail.com
Mon Feb 20 22:42:22 CET 2012
This isn't being plotted with any special time series methods (because
it's not a time-based object here) so ?abline will work.
Michael
On Mon, Feb 20, 2012 at 12:14 PM, anaraster <rrasterr at gmail.com> wrote:
> How can I had a trend line to my plot?
>
> My data looks like this:
>
> Date=seq(as.Date("1910/1/1"), as.Date("1920/1/1"), "day")
> Values=runif(length(Date), min=-5, max=5)
>
> dataset=data.frame(Values,as.Date(Date))
>
> I just want to add a linear trend line to this
> plot(dataset,col=rgb(1,0,0,1/8),cex=0.5,pch=19)
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Time-Series-Trend-Line-tp4404582p4404582.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
More information about the R-help
mailing list