Stack with data for estimation and prediction

Stack for prediction:

stk.p <- inla.stack(
  tag = "pred",
  data = list(y = rep(NA, nrow(coop)), e = rep(0, nrow(coop))),
  A = list(1, A.p),
  effects = list(
    data.frame(b0 = rep(1, nrow(coop))),
    list(s = 1:nmesh)
  )
)

Combine both stacks:

stk.full <- inla.stack(stk.e, stk.p)