ajdamico / asdfree

analyze survey data for free
http://asdfree.com/
GNU General Public License v3.0
609 stars 450 forks source link

Error downloading PNS #352

Closed bkarmo closed 8 months ago

bkarmo commented 4 years ago

download the microdata to your local computer

pns_cat <- lodown( "pns" , pns_cat ) locally downloading pns

downloading from URL 'ftp://ftp.ibge.gov.br/PNS/2013/microdados/pns_2013_microdados_2017_03_23.zip' to file '/var/folders/df/9bg_zkpd0xdggmd1zb0cw9rw0000gn/T//RtmpszPWAG/filea087afa0c8'

download issue with 'ftp://ftp.ibge.gov.br/PNS/2013/microdados/pns_2013_microdados_2017_03_23.zip'

download issue with 'ftp://ftp.ibge.gov.br/PNS/2013/microdados/pns_2013_microdados_2017_03_23.zip'

download issue with 'ftp://ftp.ibge.gov.br/PNS/2013/microdados/pns_2013_microdados_2017_03_23.zip'

R version 3.6.1 (2019-07-05) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Mojave 10.14.6

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.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] lodown_0.1.0 openxlsx_4.1.4 broom_0.5.3 abjutils_0.2.3 data.table_1.12.8 [6] lubridate_1.7.4 forcats_0.4.0 stringr_1.4.0 dplyr_0.8.3 purrr_0.3.3
[11] readr_1.3.1 tidyr_1.0.2 tibble_2.1.3 ggplot2_3.2.1 tidyverse_1.3.0

loaded via a namespace (and not attached): [1] tidyselect_1.0.0 haven_2.2.0 lattice_0.20-38 colorspace_1.4-1 vctrs_0.2.2
[6] generics_0.0.2 rlang_0.4.4 pillar_1.4.3 glue_1.3.1 withr_2.1.2
[11] DBI_1.1.0 dbplyr_1.4.2 modelr_0.1.5 readxl_1.3.1 lifecycle_0.1.0 [16] munsell_0.5.0 gtable_0.3.0 cellranger_1.1.0 rvest_0.3.5 zip_2.0.4
[21] curl_4.3 fansi_0.4.1 Rcpp_1.0.3 scales_1.1.0 backports_1.1.5 [26] jsonlite_1.6.1 fs_1.3.1 hms_0.5.3 digest_0.6.24 stringi_1.4.6
[31] grid_3.6.1 cli_2.0.1 tools_3.6.1 bitops_1.0-6 magrittr_1.5
[36] lazyeval_0.2.2 RCurl_1.98-1.1 crayon_1.3.4 pkgconfig_2.0.3 xml2_1.2.2
[41] reprex_0.3.0 assertthat_0.2.1 httr_1.4.1 rstudioapi_0.11 R6_2.4.1
[46] nlme_3.1-143 compiler_3.6.1

lodown is now exiting unexpectedly. websites that host publicly-downloadable microdata change often and sometimes those changes cause this software to break. if the error call stack below appears to be a hiccup in your internet connection, then please verify your connectivity and retry the download. otherwise, please open a new issue at https://github.com/ajdamico/asdfree/issues with the contents of this error call stack and also the output of your sessionInfo().

[[1]] lodown("pns", pns_cat)

[[2]] withCallingHandlers(catalog <- load_fun(data_name = data_name, catalog, ...), error = function(e) { print(sessionInfo()) if (grepl("cannot allocate vector of size", e)) message(memory_note) else if (grepl("parameter must be specified", e)) message(parameter_note) else if (grepl("to install", e)) message(installation_note) else { message(unknown_error_note) print(sys.calls()) } })

[[3]] load_fun(data_name = data_name, catalog, ...)

[[4]] cachaca(catalog[i, "full_url"], tf, mode = "wb")

[[5]] httr_filesize(this_url, attempts, sleepsec)

[[6]] stop(paste0("httr::HEAD( '", url, "' )\nfailed after ", initial.attempts, " attempts"))

[[7]] .handleSimpleError(function (e) { print(sessionInfo()) if (grepl("cannot allocate vector of size", e)) message(memory_note) else if (grepl("parameter must be specified", e)) message(parameter_note) else if (grepl("to install", e)) message(installation_note) else { message(unknown_error_note) print(sys.calls()) } }, "httr::HEAD( 'ftp://ftp.ibge.gov.br/PNS/2013/microdados/pns_2013_microdados_2017_03_23.zip' )\nfailed after 3 attempts", base::quote(httr_filesize(this_url, attempts, sleepsec)))

[[8]] h(simpleError(msg, call))

Error in httr_filesize(this_url, attempts, sleepsec) : httr::HEAD( 'ftp://ftp.ibge.gov.br/PNS/2013/microdados/pns_2013_microdados_2017_03_23.zip' ) failed after 3 attempts

ajdamico commented 8 months ago

hi! apologies for the long delay. i've made a couple of big updates to asdfree.com that hopefully make the website a bit better, but i've decided to stop maintaining the lodown package so probably won't fix the bug you've reported. the new asdfree does have pns data, but only for the most current year. thanks