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

Geospatial Spatialcovariate files will be not read correctly #64

Closed
OJWatson opened this issue Nov 29, 2018 · 4 comments · Fixed by #69
Closed

Geospatial Spatialcovariate files will be not read correctly #64

OJWatson opened this issue Nov 29, 2018 · 4 comments · Fixed by #69
Labels
bug Something isn't working

Comments

@OJWatson
Copy link
Collaborator

The geospatial covariates csv files that you can download from the DHS website do not have support yet for being read in. Need to add a better catch and stop/warning message for these.

image


However, currently you should not be able to download these, as I do not place geospatial covariate files into the available datasets function. So @nickbrazeau could you attach the output of get_available_datasets() as an .rds that would be great and i can figure out how they got there :)

@nickbrazeau
Copy link

Hey OJ,

Here is the code chunk I used to produce the issue above.

rdhs::set_rdhs_config(email = "nbrazeau@med.unc.edu",
                      project = "Malaria Spatiotemporal Analysis",
                      config_path = "rdhs.json",
                      global = FALSE,
                      cache_path = "/Users/NFB/Documents/GitHub/VivID_Epi")

survs <- rdhs::dhs_surveys(countryIds = c("CD"),
                     surveyYearStart = 2013)


datasets <- rdhs::dhs_datasets(surveyIds = survs$SurveyId,
                         fileFormat = "flat")

# debug
availdatasets <- rdhs::get_available_datasets()
readr::write_rds(x=availdatasets, path = "~/Google_Drive/PhD_Work/sandbox/avail_datasets_dhs.rds")


# download all DHS datsets 
downloads <- rdhs::get_datasets(datasets$FileName) 

I've hosted the .rds here which includes other geospatial covariates (interestingly).

Here is my rdhs client file/json:

{
"email": "nbrazeau@med.unc.edu",
"project": "Malaria Spatiotemporal Analysis",
"password": ****",
"cache_path": "/Users/NFB/Documents/GitHub/VivID_Epi",
"config_path": "rdhs.json",
"global": false,
"verbose_download": false,
"verbose_setup": true,
"timeout": 30,
"data_frame": null,
"project_choice": null
}

And here is my session info:

R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin17.6.0 (64-bit)
Running under: macOS  10.14.1

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
 [1] rdhs_0.6.0      forcats_0.3.0   stringr_1.3.1   dplyr_0.7.7     purrr_0.2.5     readr_1.2.1     tidyr_0.8.2     tibble_1.4.2    ggplot2_3.1.0   tidyverse_1.2.1

loaded via a namespace (and not attached):
 [1] storr_1.2.1      tidyselect_0.2.5 haven_2.0.0      lattice_0.20-35  colorspace_1.3-2 yaml_2.2.0       rlang_0.3.0.1    pillar_1.3.0     glue_1.3.0      
[10] withr_2.1.2      rappdirs_0.3.1   sp_1.3-1         modelr_0.1.2     readxl_1.1.0     bindrcpp_0.2.2   bindr_0.1.1      plyr_1.8.4       munsell_0.5.0   
[19] gtable_0.2.0     cellranger_1.1.0 rvest_0.3.2      devtools_1.13.6  memoise_1.1.0    qdapRegex_0.7.2  curl_3.2         broom_0.5.0      Rcpp_1.0.0      
[28] scales_1.0.0     backports_1.1.2  jsonlite_1.5     hms_0.4.2        digest_0.6.18    stringi_1.2.4    getPass_0.2-2    grid_3.5.1       rgdal_1.3-6     
[37] cli_1.0.1        tools_3.5.1      magrittr_1.5     lazyeval_0.2.1   crayon_1.3.4     pkgconfig_2.0.2  xml2_1.2.0       lubridate_1.7.4  assertthat_0.2.0
[46] httr_1.3.1       rstudioapi_0.7   R6_2.3.0         nlme_3.1-137     compiler_3.5.1   git2r_0.21.0 

@OJWatson
Copy link
Collaborator Author

Tracked it down - if you request SPA datasets from the DHS this will cause Geospatial covariates to be included. Have addressed in 973dced

@OJWatson
Copy link
Collaborator Author

@nickbrazeau - if you fancy checking that this now works for you (it's in the master branch) that would be good, but no rush, i'll have a check once the DHS approves my reqest for the SPA datasets as well.

@OJWatson
Copy link
Collaborator Author

Not fully fixed - just noticed a bug in this.

@OJWatson OJWatson added the bug Something isn't working label Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants