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

Extract.linim

Extract Subset of Pixel Image on Linear Network


Description

Extract a subset of a pixel image on a linear network.

Usage

## S3 method for class 'linim'
x[i, ..., drop=TRUE]

Arguments

x

A pixel image on a linear network (object of class "linim").

i

Spatial window defining the subregion. Either a spatial window (an object of class "owin"), or a logical-valued pixel image, or any type of index that applies to a matrix, or a point pattern (an object of class "lpp" or "ppp"), or something that can be converted to a point pattern by as.lpp (using the network on which x is defined).

...

Additional arguments passed to [.im.

drop

Logical value indicating whether NA values should be omitted from the result.

Details

This function is a method for the subset operator "[" for pixel images on linear networks (objects of class "linim").

The pixel image x will be restricted to the domain specified by i.

Pixels outside the domain of x are assigned the value NA; if drop=TRUE (the default) such NA values are deleted from the result; if drop=FALSE, then NA values are retained.

If i is a window (or a logical-valued pixel image) then x[i] is another pixel image of class "linim", representing the restriction of x to the spatial domain specified by i.

If i is a point pattern, then x[i] is the vector of pixel values of x at the locations specified by i.

Value

Another pixel image on a linear network (object of class "linim") or a vector of pixel values.

Author(s)

Examples

M <- as.mask.psp(as.psp(simplenet))
  Z <- as.im(function(x,y){x}, W=M)
  Y <- linim(simplenet, Z)
  X <- runiflpp(4, simplenet)
  Y[X]
  Y[square(c(0.3, 0.6))]

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.