netsplit: Incorporate Point Patterns into a Network

View source: R/kmeansbary.R

netsplitR Documentation

Incorporate Point Patterns into a Network

Description

Given a network and a list of point patterns on this network, create a new network from all the vertices of the original network plus all the points in the patterns, splitting any edges that contain such points into several shorter edges. This function keeps track which vertex-indices represent each of the data point patterns. The returned object contains all the components needed for a call to kmeansbarynet.

Usage

netsplit(network, pplist)

Arguments

network

an object of class linnet or lpp. In the latter case the domain component is extracted and any points of the lpp are ignored.

pplist

a list containing (at least) x- and y-coordinates of the point patterns, which will be projected onto the network

Details

This function relies heavily on code from the package spatstat to create the new network and efficiently compute all pairwise shortest-path distances between the new vertices.

If not all point patterns are of the same size, this function fills up the vertex-indices of the smaller patterns with a virtual index that is one larger than the maximal index appearing in the new network. This structure is required for calling kmeansbarynet.

Value

A list containing the following components:

network

the new network with all the points added as vertices. Contains also the matrix of shortest-path distances between all these points.

ppmatrix

a matrix containing the new vertex-indices of the data point patterns, one column corresponds to one point pattern.

dimensions

a vector containing the cardinalities of the data point patterns.

nvirtual

the index of the virtual point.

Author(s)

Raoul Müller raoul.mueller@uni-goettingen.de
Dominic Schuhmacher schuhmacher@math.uni-goettingen.de

See Also

kmeansbarynet

Examples

# See the example for kmeansbarynet.


ttbary documentation built on Nov. 16, 2022, 5:15 p.m.

Related to netsplit in ttbary...