Merging survey data with geographic data



I am trying to merge DHS survey data set with geographic data by using the comment, data.combined<-, shp=shp, dbf=dbf).
However I got the following error message, "None of the rownames of the data object match the first column of the dbf object". There are 4731 respondents in my survey data set (housedata). The first column of the dbf data file is DHSID (actually cluster number) which is like this BD201400000001, ...........BD201400000600. In my survey data set, the row names are 1,......4731 which was collected from 600 clusters. Any help would be appreciate to complete this job.


Ideally, you'd give us a reproducible example (reprex) of your issue as a starting point. A reprex makes it much easier for others to understand your issue and figure out how to help. A lack of a reprex just makes it much less likely others will reply.

That being said, your error seems pretty self-explanatory; that function is trying to merge on the first columns of your data-object and dbf, but there are no matching values in these two columns.

I haven't worked with the CARBayes package much (which has the function), but I suspect just a bit of data wrangling with get you sorted. If you can, I'd provide a reprex, including the data or a sample of the data.