I tried to implement this great blog post by Gavin Simpson using data downloaded from the cancensus package, but I get the following error when trying to evaluate the gam
:
Error in smooth.construct.mrf.smooth.spec(object, dk$data, dk$knots) :
mismatch between nb/polys supplied area names and data area names
In addition: Warning message:
In if (all.equal(sort(a.name), sort(levels(k))) != TRUE) stop("mismatch
between nb/polys supplied area names and data area names") :
the condition has length > 1 and only the first element will be used
I have posted my minimal working example here. Any tips would be greatly appreciated.
Best, Zoltan