GithubHelp home page GithubHelp logo

Comments (2)

harryprince avatar harryprince commented on September 21, 2024

This issue is due to the low version of sf, after upgrade sf package, sf::sf_extSoftVersion()["PROJ"] return is not NA

from sfnetworks.

agila5 avatar agila5 commented on September 21, 2024

Hi @harryprince and thanks for your message.

@luukvdmeer I just noticed that sf::sf_extSoftVersion()["PROJ"] is defined only for sf >= 1.0 (see r-spatial/sf@9aa8a62#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:

sfnetworks/R/zzz.R

Lines 89 to 90 in 28cbfb8

.onAttach = function(libname, pkgname) {
if (sf::sf_extSoftVersion()["PROJ"] < "6.0.0" || sf::sf_extSoftVersion()["proj.4"] < "6.0.0") {

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.

from sfnetworks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.