Skip to content

Drop regions with no links? #178

Open
@thomashudsonuk

Description

@thomashudsonuk

When running poly2nb on a sf spatial dataframe I get regions with no links. I'm using this neighbours list to create matrix for an INLA spatial model, which as I understand it requires no regions with no links. Is there a way to automatically drop those regions with no links/ extract them list to a different variables?

I'm imagine the solution to look something like:

nb <- poly2nb(polygons)
nb$no_links # to display those regions with no links so I can iterate and remove them

or

nb <- poly2nb(polygons, force_no_links = TRUE) # some parameter which does the above automatically, default to FALSE

Is this possible? Please let me know if you need more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions