Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Extract.linnet

Extract Subset of Linear Network


Description

Extract a subset of a linear network.

Usage

## S3 method for class 'linnet'
x[i, ..., snip=TRUE]

Arguments

x

A linear network (object of class "linnet").

i

Spatial window defining the subregion. An object of class "owin".

snip

Logical. If TRUE (the default), segments of x which cross the boundary of i will be cut by the boundary. If FALSE, these segments will be deleted.

...

Ignored.

Details

This function computes the intersection between the linear network x and the domain specified by i.

This function is a method for the subset operator "[" for linear networks (objects of class "linnet"). It is provided mainly for completeness.

The index i should be a window.

The argument snip specifies what to do with segments of x which cross the boundary of i. If snip=FALSE, such segments are simply deleted. If snip=TRUE (the default), such segments are cut into pieces by the boundary of i, and those pieces which lie inside the window i are included in the resulting network.

Value

Another linear network (object of class "linnet").

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz, Ege Rubak rubak@math.aau.dk and Suman Rakshit.

Examples

p <- par(mfrow=c(1,2), mar=0.2+c(0,0,1,0))
  B <- owin(c(0.1,0.7),c(0.19,0.6))

  plot(simplenet, main="x[w, snip=TRUE]")
  plot(simplenet[B], add=TRUE, col="green", lwd=3)
  plot(B, add=TRUE, border="red", lty=3)

  plot(simplenet, main="x[w, snip=FALSE]")
  plot(simplenet[B, snip=FALSE], add=TRUE, col="green", lwd=3)
  plot(B, add=TRUE, border="red", lty=3)

  par(p)

spatstat.linnet

Linear Networks Functionality of the 'spatstat' Family

v2.1-1
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Ottmar Cronie [ctb], Tilman Davies [ctb], Greg McSwiggan [ctb], Suman Rakshit [ctb]
Initial release
2021-03-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.