sdcTools / sdcMicro

sdcMicro
http://sdctools.github.io/sdcMicro/
79 stars 23 forks source link

sdcApp breaks when importing foreign datasets (STATA, SPSS) since haven version 2.3.0 #308

Closed thijsbenschop closed 3 years ago

thijsbenschop commented 3 years ago

After updating the haven package to version 2.3.0 (or 2.3.1), sdcApp breaks when uploading foreign files (tested with STATA files). The error displayed in the app is the following:

Screenshot 2020-12-21 at 19 54 55

No further error messages in the console. One difference between the different haven versions is that the variables of class haven_labelled now also have two more classes: vctrs_vctr and double. The conversion to factor in the readMicrodata function seems to run fine though.

When I load the dataset using the readMicrodata function in the console and subsequently load the file using the Testdata/internal data option in sdcApp, all works fine. It's not clear what the difference is between these two approaches.

At this moment, sdcApp is not functioning when users upgraded to haven 2.3.0 or 2.3.1 and use other data formats, such as STATA files.

bernhard-da commented 3 years ago

@thijsbenschop do you have a test stata file?

mwelch750 commented 3 years ago

Hi Bernard,

It appears any Stata file will trigger the issue. I attach an open dataset for you to test with. World_Bank_Honduras_L2L_HH_All_Modes.zip

File comes from here: https://microdata.worldbank.org/index.php/catalog/2021

Hope this helps.

bernhard-da commented 3 years ago

@thijsbenschop thx, works for me with the current github version (devtools::install_github("sdcTools/sdcMicro")). can you confirm that?

thijsbenschop commented 3 years ago

@bernhard-da , thanks, with the GitHub version I can upload STATA files without getting the problem. Do you plan a CRAN release of the sdcMicro package anytime soon?

bernhard-da commented 3 years ago

@thijsbenschop thx for testing. can't say a specific date as i want to add some improved utility measures before. but very likely after the holidays...

thijsbenschop commented 3 years ago

@bernhard-da, thanks! I will close this issue.