Closed harryprince closed 2 years ago
This issue is due to the low version of sf
, after upgrade sf package, sf::sf_extSoftVersion()["PROJ"]
return is not NA
Hi @harryprince and thanks for your message.
@luukvdmeer I just noticed that sf::sf_extSoftVersion()["PROJ"]
is defined only for sf >= 1.0
(see https://github.com/r-spatial/sf/commit/9aa8a6222873d6c181464d226e9bad83d17a55d1#diff-1e8c7b94d7dc2f0d70c4e457124889b5637ba42993015643e5d80be52e3ec912), and the package loading fails for older versions (at least on windows):
remotes::install_version("sf", "0.9.8", quiet = TRUE)
remotes::install_cran("sfnetworks", quiet = TRUE)
library(sfnetworks)
#> Registered S3 method overwritten by 'spatstat.geom':
#> method from
#> print.boxx cli
#> Error: package or namespace load failed for 'sfnetworks':
#> .onAttach failed in attachNamespace() for 'sfnetworks', details:
#> call: if (sf::sf_extSoftVersion()["PROJ"] < "6.0.0" || sf::sf_extSoftVersion()["proj.4"] <
#> error: missing value where TRUE/FALSE needed
Created on 2022-01-03 by the reprex package (v2.0.1)
I think we should slightly adjust the following if-clause:
with something like:
.onAttach = function(libname, pkgname) {
if (sf::sf_extSoftVersion()["proj.4"] < "6.0.0") {
I'm not 100% sure it is safe to ignore the output of sf::sf_extSoftVersion()["PROJ"]
, but it looks like it returns the same value as sf::sf_extSoftVersion()["proj.4"]
. If you agree, I can create a PR.
Describe the bug
proj.4 6.X is installed, but still fail to install.
Reproducible example
R Session Info