This is the code for creating the linear trend
fit <- lm(a1TS~t) fit coefT <- coef(fit) coefT[1] coefT[2] t <- time(a1TS) coefT <- coef(lm(a1TS~t)