robjhyndman / demography

demography package for R
https://pkg.robjhyndman.com/demography
73 stars 25 forks source link

issue with Rmd and demography package: pdf not compiling #51

Closed HeloiseLabit closed 1 year ago

HeloiseLabit commented 1 year ago

Hi, I am having trouble compiling a pdf with Rmd while using the demography package for several weeks now. The pdf compiles well but as soon as I add the hmd.mx() function it does not compile anymore. The R code with hmd.mx() works fine alone. I also tried creating a very simple Rmd with only that particular code and I get the same error. I also tried on a different computer. Here is the error message: Screenshot 2023-03-07 at 1 13 21 pm

I was wondering if you have encountered a similar issue before and/or if you had some ideas for how to resolve it. I was also wondering if it could be a similar issue to the one in this post: https://github.com/colindouglas/retrosheet/issues/1.

Thanks in advance for any help.

robjhyndman commented 1 year ago

Assuming you're using v2.0 of the demography package, then hmd.mx() is using HMDHFDplus::readHMDweb() to handle the downloading. So if it is a connection problem, it is caused there, not within the demography package. Have you tried using HMDHFDplus::readHMDweb() directly, and does it still cause a problem?

HeloiseLabit commented 1 year ago

Thanks for your quick and helpful answer! Yes, the issue is still there when using HMDHFDplus::readHMDweb() directly, so looks like that's where the problem is.