JeremyGelb / spNetwork

An R package to perform spatial analysis on networks.
GNU General Public License v2.0
34 stars 2 forks source link

upcoming sf release breaks spNetwork on CRAN #13

Closed edzer closed 1 year ago

edzer commented 1 year ago

Using the CRAN submission, we see

  Running ‘testthat.R’
 ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
      ▆
   1. └─spNetwork:::correction_factor(...) at test_border_correction_sf.R:105:2
   2.   └─sf::st_distance(events, boundaries, by_element = TRUE)
   3.     └─base::stopifnot(!missing_y, length(x) == length(y))
  ── Error (test_border_correction_sf.R:176:3): Testing the correction_factor function for a continuous NKDE ──
  Error in `st_distance(events, boundaries, by_element = TRUE)`: length(x) == length(y) is not TRUE
  Backtrace:
      ▆
   1. └─spNetwork:::correction_factor(...) at test_border_correction_sf.R:176:2
   2.   └─sf::st_distance(events, boundaries, by_element = TRUE)
   3.     └─base::stopifnot(!missing_y, length(x) == length(y))

  [ FAIL 3 | WARN 9 | SKIP 0 | PASS 69 ]

The changes in sf are here: https://github.com/r-spatial/sf/commit/3e1fd7c1475288e703495d20ebfada211d6dd0f6 as you see is now enforced that x and y have equal length geometries when by_element = TRUE; I can't see how otherwise by_element=TRUE would make sense.

edzer commented 1 year ago

The sf submission has just been accepted on CRAN - I apologize for not reporting this in a timely fashion, there was some urgency here (changes in R-devel affecting sf).

JeremyGelb commented 1 year ago

No problem.I had a quick look amd it seems that the parameter by_elements is here because the package was using sp and rgeos before. I will do the corelrection as soon as possible

Le mar. 8 nov. 2022, 11 h 32, Edzer Pebesma @.***> a écrit :

The sf submission has just been accepted on CRAN - I apologize for not reporting this in a timely fashion, there was some urgency here (changes in R-devel affecting sf).

— Reply to this email directly, view it on GitHub https://github.com/JeremyGelb/spNetwork/issues/13#issuecomment-1307495880, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALFPUIPYR4O6QVYUGRCX3KLWHJ6ALANCNFSM6AAAAAAR2LSN3A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

JeremyGelb commented 1 year ago

Solved with the last version published on CRAN

edzer commented 1 year ago

Great, thanks!