How to create a loop that will make regression models in R? : <p>I have data that looks something like this, there is time series data for many species over multiple years.</p>

<pre><code>Species    year  x
species1   2000  56
species1   2001  12
species1   2002  40
species2   2000  30
species2   2001  40
species2   2002  50
</code></pre>

<p>For each species, I would like to create a regression model of x vs year, I would also like to plot each model and find the slope of every trendline. To do this, I suspect I should use some type of loop.</p>
