Hi, I’m trying to merge 2 shape files from the year 1850 (from NHGIS). One has agricultural data and the other has demographic data. So far these 2 are easily read through
read_nhgis_sf but at the time I want to merge them into a single file I have some problems.
I tried with
st_join from the
sf package to merge the 2 shape files into one, but the result is a colossal file of 10k rows, with quadruplicated values or more (the original files only had around 1650 rows).
The closest to a solution that I’ve reached was to read individually only the datasets thorugh
read_nhgis, then merge those datasets with base R
merge and then join the resulting dataset with a shape file with
ipums_shape_inner_join. So far this is giving me an acceptable shape file but all the metadata and description of variables is lost. And with 60 different values being able to read them straight from Rstudio comes really handy instead of having to open the codebook and seeing which one is which.
Is there any solution to keep the metadata in the shapefile or maybe to add it later? Thank you