Skip to contents

This function sets up the root and ensures that all nodes are connected to it, and preserves any old data. Any nodes not connected to the root are removed. By default, the function will root the network at the closest existing node to the specified root. Set tolerance = 0 to instead cause the function to create a new node

Usage

RootNetwork(network, root, root.crs, tolerance = Inf)

Arguments

network

A sfnetwork

root

A sf point, or coordinates for the new root

root.crs

a crs or string for the root, if it is different from the network

tolerance

A distance that determines whether to use existing nodes or blend in a new one

Value

A sfnetwork with the new root