In R, I have a dataset of (x, y) points that is constantly being updated via simulation (values are appended to the end of the dataset).
I would like to compute the Slope (via a linear model) of the line created by the data using only the last 10 listed datapoints.
The confusion here arises from the fact that the data are Changing, and so I suspect a loop may be needed to iterate over the indices of the datapoints.
In R, one usually does something like
linreg summary.linreg beta0
The change that is needed in my case is in linreg, specifically
For a non-changing dataset of 10 x-y points, one simply does [?] = [1:10] and the problem is Solved. In my case though, I am at a standstill as to the best way to proceed efficiently.
Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered