robjhyndman / demography

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

Dependency on ftsa #38

Closed carlboe closed 5 years ago

carlboe commented 5 years ago

The code base was changed (commit 624f5f2601658346a5c1a1fae88cb73413dedae2) regarding dependency on library 'ftsa'. To DESCRIPTION was added 'Imports: ftsa (>= 4.8)' . I think that the intention was to remove 'import(ftsa)' from the NAMESPACE file, but that did not change.

library ftsa currently stands at version 3.8 on github, so the criterion in the DESCRIPTION file cannot be met and the demography package on github cannot be installed.

robjhyndman commented 5 years ago

ftsa on CRAN is currently version 5.0 (https://cran.r-project.org/package=ftsa). I don't think the maintainer has a github version. Can you please share where you got v3.8 from?

ftsa is now only in the imports field, and not in the depends field.

carlboe commented 5 years ago

My mistake. https://github.com/hanshang/ftsa I see that this is very old.

I have R 3.4.x on all platforms and cannot install ftsa from CRAN to satisfy the dependency for demography without downloading the package and manually removing the dependency declaration from NAMESPACE and/or DESCRIPTION

robjhyndman commented 5 years ago

Modifying the dependency declaration may cause a package to break. The version dependency is not arbitrary, but because it is needed. Update to R3.5.x and stop using old software.

carlboe commented 5 years ago

Don't blame the messenger.

I posted the issue because broken hmd.mx is the number one request coming into HMD from users.

I have no control over what version of R those users run. R 3.4 is standard and current on Debian/Ubuntu LTS distributions. The situation is:

CRAN version of demography (1.20) is marked as R (>=3.4) but imports ftsa (R >=3.5), so demography 1.20 really requires R >=3.5 to be installed.

Demography (1.20) from CRAN, even if installed, will have a broken hmd.mx() functionality because TLS is required to scrub the mortality.org website now. and that fix is not yet present on CRAN.

Installation from github (v. 1.21) also has a dependency on ftsa, hence requires R (>= 3.5).

Close this if you wish. But the problems remain.

robjhyndman commented 5 years ago

I still don't understand the issue.

demography depends on ftsa >=4.8 (not 5). ftsa 4.8 requires R >=3.4.0. So a user on R3.4 should be able to install demography 1.21 and ftsa 4.8, everything should work.

I do plan to update demography on CRAN to v1.21 soon.

carlboe commented 5 years ago

I don't claim deep knowledge about the dependency structure. I can relay what happens on a pretty generic Ubuntu 16.04 LTS linux system with R 3.4: install.packages("demography", dep=TRUE) leads to installation of dependencies 'forecast' but dependency 'ftsa' is not installed, resulting in:

ERROR: dependency ‘ftsa’ is not available for package ‘demography’

  • removing ‘/home/boe/R/x86_64-pc-linux-gnu-library/3.4/demography’

Attempting to satisfy the dependency: install.packages("ftsa", dep=TRUE) gives:

Warning message: package ‘ftsa’ is not available (for R version 3.4.4) since CRAN defaults to serving up the latest ftsa, rather than version 4.8

For R 3.4 users, the following will work, although it is not terribly standard:

--- install older version of ftsa, because R <= 3.4

install.packages(pkg="https://cran.r-project.org/src/contrib/Archive/ftsa/ftsa_4.8.tar.gz", dep=TRUE) library(devtools) install_github("robjhyndman/demography") # v.1.21

The best solution is R 3.5+ and demography v1.21 I will urge that on users. Thanks.

Alternative solution? pull plot.ftsm.R from the ftsa package, include in demography and make ftsa a suggestion rather than a dependency.

robjhyndman commented 5 years ago

Yes, that will work. I had (probably mistakenly) assumed that CRAN would install the most recent version of a package which will work with the installed version of R.

It's not just plot.ftsm() that demography uses. It is also ftsm() which is the main modelling function. So I don't think making ftsa a suggestion will work.

I don't actually know why ftsa has made Rv3.5 a requirement. I will ask the maintainer if there is a good reason, and if not whether he can make it something earlier instead.

robjhyndman commented 5 years ago

ftsa 5.1 now depends on R (≥ 3.4.0). So installing demography v1.21 should now work on R3.4.