The code you have should work. I would just make sure that “ipumsi_ddi_file” corresponds to the ddi file of your IPUMS USA extract. If the issue persists, you could use the following to create a subset of the full data set with your columns of interest:
data <- subset(test, select = c(YEAR,MET2013,PERWT)
Can you check to see if the following works for reading in a subset of the example extract included in the ipumsr package?
vars = c(YEAR, SERIAL),
n_max = 10
If not, you should try reinstalling ipumsr from cran using: install.packages(‘ipumsr’)