I am working to re-aggregate population counts from one administrative level to another. One particular row keeps returning the error "replacement has 4 rows, data has 2".
I have tried validating the geometries, but it has not worked. Neither did a buffer with 0 distance.
I was preparing the dummy data for posting this question using dput(). After saving the dput() of the sf layers into a text file, the command line works after re-assigning the variables. This only works when using the dput output saved in a textfile, but it does not work if I directly do
st_interpolate_aw(dput(geography1),dput(geography2), extensive = TRUE)
.
This returns the same error.
Is there any known reason why the error might be happening, and how saving the dput() output into a .txt file might be removing the error?
note - Is there any way to share the features other than dput()? the high amount of vertices in one of the layers surpasses the character limit for the question
edit I think I managed to export a geojson with the error, in case you are interested in checking it: https://drive.google.com/file/d/1wF6AB1oHVEkcuI4iRAloLO56DL_8EZBr/view?usp=sharing