American-Institutes-for-Research / EdSurvey

https://american-institutes-for-research.github.io/EdSurvey/
GNU General Public License v2.0
9 stars 8 forks source link

Issue reading PISA 2012 data #82

Closed AndersAstrup closed 1 month ago

AndersAstrup commented 1 month ago

The readPISA() function does not seem to work specifically for the 2012 study, although it works for 2009 and 2015 and others. Maybe the files have been altered at the source (OECD)?

I get the same error whether i 1) set cache=T in the downloadPISA function or 2) download the data with cache=F and then attempting to load the data with readPISA():

Missing PISA Datafile(s) (INT database) in the path ‘C:/ILSA_DATA/PISA/2012’

Reproducible example:

library(EdSurvey)
#version 1
downloadPISA(root = "C:\\ILSA_DATA\\", years = 2012, cache = T, verbose = T)
#version 2
downloadPISA(root = "C:\\ILSA_DATA\\", years = 2012, cache = F, verbose = T)
pisa12 <- readPISA(path = "C:\\ILSA_DATA\\PISA\\2012", database = "INT", countries = c("dnk"))

Sessioninfo:

R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=Danish_Denmark.utf8  LC_CTYPE=Danish_Denmark.utf8    LC_MONETARY=Danish_Denmark.utf8 LC_NUMERIC=C                   
[5] LC_TIME=Danish_Denmark.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] EdSurvey_4.0.7 Dire_2.2.0     lfactors_1.0.4 car_3.1-3      carData_3.0-5 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.13         cellranger_1.1.0    nloptr_2.1.1        pillar_1.9.0        compiler_4.2.2      forcats_1.0.0       iterators_1.0.14   
 [8] tools_4.2.2         NAEPirtparams_1.0.0 boot_1.3-28.1       lme4_1.1-35.5       lifecycle_1.0.4     tibble_3.2.1        nlme_3.1-162       
[15] lattice_0.21-8      LaF_0.8.4           pkgconfig_2.0.3     rlang_1.1.1         Matrix_1.6-1        foreach_1.5.2       cli_3.6.1          
[22] rstudioapi_0.17.0   SparseM_1.84-2      haven_2.5.4         xml2_1.3.6          wCorr_1.9.8         MatrixModels_0.5-3  vctrs_0.6.5        
[29] hms_1.1.3           grid_4.2.2          data.table_1.16.2   glue_1.8.0          fansi_1.0.6         readxl_1.4.3        survival_3.5-5     
[36] minqa_1.2.8         Formula_1.2-5       glm2_1.2.1          NAEPprimer_1.0.1    magrittr_2.0.3      matrixStats_1.4.1   codetools_0.2-19   
[43] MASS_7.3-60         splines_4.2.2       mnormt_2.1.1        abind_1.4-8         xtable_1.8-4        numDeriv_2016.8-1.1 quantreg_5.98      
[50] utf8_1.2.4          WeMix_4.0.3
pdbailey0 commented 1 month ago

try github installing the version I pushed today. I hope that works for you. Here's the NEWS.

AndersAstrup commented 1 month ago

It works. Thank you very much for the quick fix!