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

Data import error #29

Closed
e-molitor opened this issue Feb 24, 2018 · 4 comments
Closed

Data import error #29

e-molitor opened this issue Feb 24, 2018 · 4 comments

Comments

@e-molitor
Copy link

@e-molitor e-molitor commented Feb 24, 2018

Dear getTBinR gurus,

this is a great application for anyone interested in tuberculosis data. Sadly enough, however, I came across a problem. After installation according to the vignette, trying to use

tb_burden <- get_tb_burden()

leads to apparant downloading of the data, they are not read in correctly, however. The screen log is:

tb_burden <- get_tb_burden()
Downloading data from: https://extranet.who.int/tme/generateCSV.asp?ds=estimates
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 272k 0 272k 0 0 192k 0 --:--:-- 0:00:01 --:--:-- 194k
Downloading the data using fread::data.table has failed. Trying
again using utils::read.csv
Downloading data has failed after 1 tries.
Attempting data download in 3.4 seconds.
Downloading data from: https://extranet.who.int/tme/generateCSV.asp?ds=estimates
Downloading the data using fread::data.table has failed. Trying
again using utils::read.csv
Downloading data has failed after 2 tries.
Attempting data download in 2.9 seconds.
Downloading data from: https://extranet.who.int/tme/generateCSV.asp?ds=estimates
Downloading the data using fread::data.table has failed. Trying
again using utils::read.csv
Downloading data has failed after 3 tries.
Attempting data download in 4.4 seconds.
Downloading data from: https://extranet.who.int/tme/generateCSV.asp?ds=estimates
Downloading the data using fread::data.table has failed. Trying
again using utils::read.csv
Downloading data has failed after 4 tries.
Attempting data download in 2.5 seconds.
Downloading data from: https://extranet.who.int/tme/generateCSV.asp?ds=estimates
Downloading the data using fread::data.table has failed. Trying
again using utils::read.csv
Downloading data has failed after 5 tries.
Attempting data download in 1.2 seconds.
Fehler in get_data(url = url, download_data = download_data, data_trans_fn = trans_burden_data, :
Data downloading has failed, check your internet connection.
If this issue is not resolved, contact the package author.
Zusätzlich: Warnmeldungen:
1: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
URL 'https://extranet.who.int/tme/generateCSV.asp?ds=estimates': status was 'Failure when receiving data from the peer'
2: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
URL 'https://extranet.who.int/tme/generateCSV.asp?ds=estimates': status was 'Failure when receiving data from the peer'
3: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
URL 'https://extranet.who.int/tme/generateCSV.asp?ds=estimates': status was 'Failure when receiving data from the peer'
4: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
URL 'https://extranet.who.int/tme/generateCSV.asp?ds=estimates': status was 'Failure when receiving data from the peer'
5: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
URL 'https://extranet.who.int/tme/generateCSV.asp?ds=estimates': status was 'Failure when receiving data from the peer'

Using wget https://extranet.who.int/tme/generateCSV.asp?ds=estimates , the data are read into a file on my local machine (GNU/Kubuntu Linux 16.04.3 LTS running Linux 4.15.5, R 3.4.3) like a charm.

I'd love a clue on how I should proceed to have the data read in properly.

Best wishes and regards,

Ernst

@e-molitor
Copy link
Author

@e-molitor e-molitor commented Feb 25, 2018

Dear getTBinR gurus,

after some browsing through your well-documented and readable sources, I found the error lay
completely within my own installation: R has been linked to an outdated version of curl; installing the current version fixes the problem I have mistakenly thought to be caused by your impressive package. Sorry for my mistake.

@e-molitor e-molitor closed this Feb 25, 2018
@seabbs seabbs reopened this Feb 25, 2018
@seabbs
Copy link
Owner

@seabbs seabbs commented Feb 25, 2018

Hi e-molitor,

Thanks for opening this - sorry you had an issue using the package. It sounds like you have resolved your immediate problem - this actually links to a wider issue that I have been looking at for a while (see CRAN checks!

I hadn't been able to find the download issue (and tbh thought it might be transient and related to the WHO database) - I am adding a patch now so that data download works with an outdated version of curl. It would be great if you could share the version you were on before you upgraded?

Best,

Sam

@e-molitor
Copy link
Author

@e-molitor e-molitor commented Feb 25, 2018

@seabbs
Copy link
Owner

@seabbs seabbs commented Feb 25, 2018

I am glad you have found it useful. It is great to hear that you are using it to teach! Let me know (i.e open an issue) if you find a feature that you think is missing whilst using the package. This could be an additional plotting function for example.

Hmm sounds interesting and as you say quite complicated. I have added an additional download route to the package (via download.file) in case this sort of issue happens again. I am not sure that this will completely prevent a reoccurrence though. For information the pull request is here.

Going to close this issue for now as I think the problem has been fixed. I may add a snapshot of the data to the package at a later date if these issues continue.

Thanks again for the detailed information.

Sam

@seabbs seabbs closed this Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.