asdfree icon indicating copy to clipboard operation
asdfree copied to clipboard

Error dowloading PNS

Open jucianom opened this issue 3 years ago • 1 comments

Hello, I'm attempting to download the microdata for PNS for analysis but I am encountering the following error. This error occurs when I run

lodown( "pns" , output_dir = file.path( path.expand( "~" ) , "PNS" ) )

[[1]] lodown("pns", output_dir = file.path(path.expand("~"), "PNS"))

[[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/2019/Microdados/historico_de_atualizacoes_20210507.txt' )\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/2019/Microdados/historico_de_atualizacoes_20210507.txt' ) failed after 3 attempts year full_url 1 2019 ftp://ftp.ibge.gov.br/PNS/2019/Microdados/historico_de_atualizacoes_20210507.txt 2 2013 ftp://ftp.ibge.gov.br/PNS/2013/Microdados/historico_atualizacao_microdados_PNS_2013_20200825.txt output_folder long_file all_file 1 C:/Users/Juciano Rodrigues/Documents/PNS/ 2019 long questionnaire survey.rds 2019 all questionnaire survey.rds 2 C:/Users/Juciano Rodrigues/Documents/PNS/ 2013 long questionnaire survey.rds 2013 all questionnaire survey.rds long_design all_design case_count 1 2019 long questionnaire survey design.rds 2019 all questionnaire survey design.rds NA 2 2013 long questionnaire survey design.rds 2013 all questionnaire survey design.rds NA

jucianom avatar May 08 '21 11:05 jucianom

are you able to submit a pull request that fixes the problem? thanks!

ajdamico avatar May 10 '21 13:05 ajdamico

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

ajdamico avatar Jan 09 '24 02:01 ajdamico