The model used in that link is for RW1 temporal prior. If I implement that example for my use case with covariates, I get the following model:
## formula for RW1
formula <- O ~ season + tas + dtr + RH +
f(ID.area, model="iid", constr=TRUE, hyper=list(prec=list(prior=sdunif))) + ## iid spatial random effect (nu_i)
f(ID.month, model = 'ar1', constr=TRUE, hyper=list(prec=list(prior=sdunif)))+ #, AR1 temporal random effect (gamma_j)
f(ID.area.month, model="generic0", Cmatrix=R, rankdef=r.def,
constr=TRUE, hyper=list(prec=list(prior=sdunif)), extraconstr=list(A=A.constr, e=rep(0,S+T-2))
Here, S = number of regions; T= number of time points
D1 <- diff(diag(T),differences=1)
Q.gammaRW1 <- as(t(D1)%*%D1,"Matrix")
R <- kronecker(Q.gammaRW2,diag(S))
r.def <- 2*S
A.constr <- kronecker(matrix(1,1,T),diag(S))
A.constr <- A.constr[-1,]
How do I formulate the A.constr matrix for AR1 and the e part in the extraconstr part?