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

as.linfun

Convert Data to a Function on a Linear Network


Description

Convert some kind of data to an object of class "linfun" representing a function on a linear network.

Usage

as.linfun(X, ...)

  ## S3 method for class 'linim'
as.linfun(X, ...)

  ## S3 method for class 'lintess'
as.linfun(X, ..., values=marks(X), navalue=NA)

Arguments

X

Some kind of data to be converted.

...

Other arguments passed to methods.

values

Optional. Vector of function values, one entry associated with each tile of the tessellation.

navalue

Optional. Function value associated with locations that do not belong to a tile of the tessellation.

Details

An object of class "linfun" represents a function defined on a linear network.

The function as.linfun is generic. The method as.linfun.linim converts objects of class "linim" (pixel images on a linear network) to functions on the network.

The method as.linfun.lintess converts a tessellation on a linear network into a function with a different value on each tile of the tessellation. The function values are specified by the argument values. It should be a vector with one entry for each tile of the tessellation; any point lying in tile number i will return the value v[i]. If values is missing, the marks of the tessellation are taken as the function values. If values is missing and the tessellation has no marks, or if values is given as NULL, then the function returns factor values identifying which tile contains each given point.

Value

Object of class "linfun".

Author(s)

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

See Also

Examples

X <- runiflpp(2, simplenet)
   Y <- runiflpp(5, simplenet)

   # image on network
   D <- density(Y, 0.1)

   f <- as.linfun(D)
   f
   f(X)

   # tessellation on network
   Z <- lineardirichlet(Y)
   g <- as.linfun(Z)
   g(X)
   h <- as.linfun(Z, values = runif(5))
   h(X)

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.