Skip to content

Commit

Permalink
Fix installation for Matrix package on R 3.6
Browse files Browse the repository at this point in the history
As the recent package version of Matrix is not compatible any more with
R versions < 4.4.0, but the Matrix package version that is automatically
shipped with R 3.6 is smaller than the minimum package version of Matrix
that coronet requires. To circumvent this problem, specifically install
Matrix version 1.3-4 from the package archives if the minimum version
required by coronet is not met. This change should not affect recent R
versions, which automatically ship a sufficient version of Matrix.

Signed-off-by: Thomas Bock <[email protected]>
  • Loading branch information
bockthom authored and maxloeffler committed May 6, 2024
1 parent 10cac49 commit cb1cf42
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions install.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
## Copyright 2015 by Wolfgang Mauerer <[email protected]>
## Copyright 2015-2017 by Claus Hunsen <[email protected]>
## Copyright 2017 by Thomas Bock <[email protected]>
## Copyright 2020-2023 by Thomas Bock <[email protected]>
## Copyright 2020-2024 by Thomas Bock <[email protected]>
## Copyright 2019 by Anselm Fehnker <[email protected]>
## Copyright 2021 by Christian Hechtl <[email protected]>
## Copyright 2024 by Leo Sendelbach <[email protected]>
Expand Down Expand Up @@ -77,10 +77,12 @@ if (length(p) > 0) {
Matrix.version = installed.packages()[rownames(installed.packages()) == "Matrix", "Version"]
if (compareVersion(Matrix.version, "1.3.0") == -1) {
print("WARNING: Matrix version 1.3.0 or higher is necessary for using coronet. Re-install package Matrix...")
install.packages("Matrix", dependencies = NA, verbose = TRUE, quiet = TRUE)
#install.packages("Matrix", dependencies = NA, verbose = TRUE, quiet = TRUE)
matrix.1.3.4.url = "https://cran.r-project.org/src/contrib/Archive/Matrix/Matrix_1.3-4.tar.gz"
install.packages(matrix.1.3.4.url, repos = NULL, dependencies = NA, verbose = TRUE, quiet = TRUE)
Matrix.version = installed.packages()[rownames(installed.packages()) == "Matrix", "Version"]
if (compareVersion(Matrix.version, "1.3.0") == -1) {
print("WARNING: Re-installation of package Matrix did not end up in the necessary packge version.")
print("WARNING: Re-installation of package Matrix did not end up in the necessary package version.")
}
}
}

0 comments on commit cb1cf42

Please sign in to comment.