I'm trying to use survey data from the FDIC 2019 survey of the unbanked. Their dataset download has an R read-in file that I was able to use last year, but no longer works. The zip file containing data and read-in file can be found on this site or downloaded directly with this link.
When I attempt to run the first example that appears at the bottom of the read-in file:
svyby(~hunbnk,~hryear4,hh_svy,svymean )
I get this error message:
Error in sum(sapply(covmats, ncol)) : invalid 'type' (list) of argument
I believe there may be an issue with the labeling of factors, but I'm not familiar enough to know how to correct it, or why it suddenly doesn't work. Likewise, I've tried uninstalling and reinstalling packages such as survey and sqldf, but it still throws an error. I'm hoping to obtain weighted mean subset data from the dataset, but don't have access to other programs to read the data.
Adding this code to the top of the file helped it run. Looks like a newer version of R caused the read-in file to fail.
options(stringsAsFactors = TRUE)