Error when trying to evaluate Markov Random Fields using mgcv::gam “mismatch between nb/polys supplied area names and data area names”
问题 I tried to implement this great blog post by Gavin Simpson using data downloaded using 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