title: How to find linear trend in R?
body: <p>I have a matrix with roughly 160 data points. I am interested in finding out if any part of that series(doesn't have to be the whole series) has a trend (linear and either increasing/decreasing). I am only interested in finding out the linear trend and not nonlinear trends.</p>
  <p>I would start by testing it on a basic data set of the form:</p>
  <pre><code>A &lt; c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,17,18,17,17,18,17,17,18,19,19,19,19,19,19,19,19,19,19,19)
  </code></pre>
  <p>Here by just plotting the data, I would think that the trend is upwards from 1:17 and I would want to introduce dummies for that (which I will be able to do once I know the trend start point and endpoint). Is there any way to know that? IN R?</p>