Your model fits a linear time trend plus a first order Fourier series approximation for the seasonality. Since you don't define
sin.t, it is not possible to tell what seasonal period you have used. You can fit a model with correct seasonal period using
t <- 1:length(NH3cH6)
cos.t <- cos(2*pi*t/365)
sin.t <- sin(2*pi*t/365)
trend <- lm(NH3cH6 ~ t + cos.t + sin.t)
However, you may need a higher order Fourier series approximation, and there are facilities in the
forecast package in R for doing that.
First, make sure the data is a time series object of the correct frequency:
NH3cH6 <- ts(NH3cH6, frequency=365)
Generate the Fourier terms for the regression (using 3 terms here, but choose the best number by minimizing the AIC of the fitted regression model).
X <- fourier(NH3cH6,3)
Fit the regression model
fit <- tslm(NH3cH6 ~ X + trend)
tslm command will understand what
trend means, and will make sure the residuals and fitted values are
ts objects with time series characteristics.
To see the result: