Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reading hierarchical IPUMS extract with many more households than persons #3

Open
dtburk opened this issue Jul 13, 2023 · 0 comments

Comments

@dtburk
Copy link
Collaborator

dtburk commented Jul 13, 2023

This error comes from hipread:::read_list(), and seems to be triggered by hierarchical extracts with many more households than persons. Here's a reprex:

library(ipumsr)

cps_extract <- define_extract_cps(
  "Read list error extract",
  samples = "cps2018_03s",
  variables = var_spec("RACE", case_selections = c("810", "812")),
  data_structure = "hierarchical"
)

ddi_path <- cps_extract |> 
  submit_extract() |> 
  wait_for_extract() |> 
  download_extract()
#> Successfully submitted IPUMS CPS extract number 106
#> Checking extract status...
#> Waiting 10 seconds...
#> Checking extract status...
#> IPUMS CPS extract 106 is ready to download.
#>   |                                                                              |                                                                      |   0%  |                                                                              |=========                                                             |  13%  |                                                                              |============================                                          |  40%  |                                                                              |======================================================================| 100%
#>   |                                                                              |                                                                      |   0%  |                                                                              |=                                                                     |   1%  |                                                                              |==                                                                    |   3%  |                                                                              |===                                                                   |   5%  |                                                                              |====                                                                  |   5%  |                                                                              |=====                                                                 |   8%  |                                                                              |=======                                                               |  10%  |                                                                              |=========                                                             |  12%  |                                                                              |==========                                                            |  15%  |                                                                              |============                                                          |  17%  |                                                                              |==============                                                        |  19%  |                                                                              |===============                                                       |  22%  |                                                                              |=================                                                     |  24%  |                                                                              |===================                                                   |  27%  |                                                                              |====================                                                  |  29%  |                                                                              |======================                                                |  31%  |                                                                              |========================                                              |  34%  |                                                                              |=========================                                             |  36%  |                                                                              |===========================                                           |  38%  |                                                                              |=============================                                         |  41%  |                                                                              |==============================                                        |  43%  |                                                                              |================================                                      |  45%  |                                                                              |=================================                                     |  48%  |                                                                              |===================================                                   |  50%  |                                                                              |=====================================                                 |  53%  |                                                                              |======================================                                |  55%  |                                                                              |========================================                              |  57%  |                                                                              |==========================================                            |  60%  |                                                                              |===========================================                           |  62%  |                                                                              |=============================================                         |  64%  |                                                                              |===============================================                       |  67%  |                                                                              |================================================                      |  69%  |                                                                              |==================================================                    |  71%  |                                                                              |====================================================                  |  74%  |                                                                              |=====================================================                 |  76%  |                                                                              |=======================================================               |  79%  |                                                                              |=========================================================             |  81%  |                                                                              |==========================================================            |  83%  |                                                                              |==============================================================        |  88%  |                                                                              |===============================================================       |  90%  |                                                                              |=================================================================     |  93%  |                                                                              |===================================================================   |  95%  |                                                                              |====================================================================  |  97%  |                                                                              |======================================================================| 100%
#> DDI codebook file saved to C:/Users/derek/AppData/Local/Temp/RtmpuG7bqO/reprex-33b867e37d41-smoky-moose/cps_00106.xml
#> Data file saved to C:/Users/derek/AppData/Local/Temp/RtmpuG7bqO/reprex-33b867e37d41-smoky-moose/cps_00106.dat.gz

read_ipums_micro_list(ddi_path)
#> Use of data from IPUMS CPS is subject to conditions including that users should cite the data appropriately. Use command `ipums_conditions()` for more details.
#> Error in read_list(file, var_names, var_types, rt_info, var_pos_info, : invalid value

Created on 2023-07-13 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant