Skip to content

Time Series - Trend Line

2 messages · Ana, R. Michael Weylandt

Ana
#
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.
#
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: