Hello,
I am trying to import an extract in r using the ipumsr
package. I’ve downloaded the data in .dta
and .dat
format with the same results. This is the error I am getting:
Error in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels) else paste0(labels, :
factor level [225] is duplicated
Here’s the code I’m using to import the file:
usa_ddi <- read_ipums_ddi("usa_00006.xml")
usa_data <- read_ipums_micro(usa_ddi, verbose = FALSE)
My extract has the following variables, besides the ones that get added automatically: CITY, RACE, HISPAN, OCC, IND, EDUC, LABFORCE, INCTOT. It samples from the 5% ACS 2017 and 2000 census.
If anyone has any clue how I could fix this, I’m all ears. I’ve updated ipumsr
to no avail, and didn’t seem to run into this issue before…