JosiahParry / sfdep

A tidy interface for spatial dependence
https://sfdep.josiahparry.com/
GNU General Public License v3.0
121 stars 5 forks source link

feature request: getting nb object and wt vector from an sfnetworks object #30

Closed idshklein closed 1 year ago

idshklein commented 1 year ago

as discussed on twitter and implemented in this gist, sfdep could enjoy a direct access to sfnetworks objects, as they have an easy approach to neighbors and weights.

JosiahParry commented 1 year ago

Thanks! A note to self: the var_from_edge works only for undirected graphs where there is a linkage between each node. Need to figure out how to cast edges to undirected

JosiahParry commented 1 year ago

https://community.rstudio.com/t/tidygraph-edge-data-as-list-column/145043/2

Answers here

JosiahParry commented 1 year ago

One thing to think about is that all of the functionality of sfdep and spdep assume that there is a column that can be used in the same dataset or a vector of the same length. This isn't true for graphs. We may want to evaluate the spatial relationships Of edge data. In this case the nb list is sort of useless because it is only associated with node data.

This means that if we want to create local indicators we may have to create methods specifically for tidy graphs

JosiahParry commented 1 year ago

There is data stored regarding edges that is not going to be stored in the nodes we can bring them into the node dataset but functions like local_join_count assume a vector which then creates a list from nb object. Whereas in our case we will already have identified the xj observations from our edge data (again, can't be taken from our nodes)

JosiahParry commented 1 year ago

see https://github.com/JosiahParry/sfdep/commit/153b28d5a0651e9834dec3f2332f2250ecbbde1e for current work

JosiahParry commented 1 year ago

Closed in https://github.com/JosiahParry/sfdep/commit/d5c3f5a2c04dc74b3f873291256eac986731247b.