r-spatial / spdep

Spatial Dependence: Weighting Schemes and Statistics
https://r-spatial.github.io/spdep/
116 stars 26 forks source link

edit.nb error: "cannot coerce type 'S4' to vector of type 'double' #133

Closed peterfredericks closed 10 months ago

peterfredericks commented 10 months ago

Hey all, trying to manually edit a neighborhood and edit.nb is throwing an error.

Using the supplied code example and code set, running into this error when attempting in R console. When using edit.nb without an assigned variable, Quartz launches but then the error hits.

edit.nb(col.gal.nb, polys=as(columbus, "Spatial"))

Error in as.double(y) : cannot coerce type 'S4' to vector of type 'double'

Sys.info:

sysname "Darwin" release "22.5.0" version "Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000" nodename "macbook-pro.lan" machine "arm64" login "root" user "~" effective_user "~"

rsbivand commented 10 months ago

Thanks very much! I'd forgotten to check that moving sp from Depends to Imports did not impact this interactive function. Now running CI on github - if you can install from source, please try it out.

peterfredericks commented 10 months ago

Happy to help! Thanks for the quick fix.

Tested, is working as expected! @rsbivand thank you again!