Fit a polynomial model column of time series data I'm asked to fit a polynomial model on the FTSE column from the EuStockMarkets dataset available in R. How is it possible to fit on just one column in this case? Is there another column of sorts in time series data that I can manipulate like time? i.e. Would time be a feature in predicting FTSE?
 A: It sounds like what you are being asked to do is fit a model in which there is a trend which is polynomial in time (where $f(t)$ is a polynomial):
$$Y_t = f(t) + \varepsilon_t$$
If the $\varepsilon_t$ are iid, you can fit this by OLS. Something like this will work:
x <- datasets::EuStockMarkets[,"FTSE"]
mod <- lm(x ~ poly(as.vector(time(x)), 3))

plot(x, main = "FTSE - 3rd degree poly trend"))
lines(ts(fitted(mod), start = start(x), frequency = frequency(x)), col = 'red')


If the $\varepsilon_t$ are actually autocorrelated, you could look at regression-with-ARIMA-errors (e.g. forecast::Arima) as a next step.
There is a small issue here which is that stock prices are not observed regularly (not on weekends or holidays, usually). In datasets::EuStockMarkets, the data is encoded as if it was regularly sampled 260 times per year, but in reality the "real" time between certain pairs of neighboring observations is longer than others, and for example you might expect that Monday's price will typically be further from the preceding Friday's than from the following Tuesday, since more time has passed in between. Regardless, the information contained in datasets::EuStockMarkets does not allow you to reconstruct the exact calendar that would include these gaps. If you could, though, you could easily fit the model with gaps by just passing in the right $t$ for each observation, whether they are equidistant or not.
I will also point out that, for stock prices specifically, this model will not be appropriate, for any degree. You'll want something like a (geometric) random walk, with GARCH effects, as a baseline.
