as.linim: Convert to Pixel Image on Linear Network

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/linim.R

Description

Converts various kinds of data to a pixel image on a linear network.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  as.linim(X, ...)

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

  ## Default S3 method:
as.linim(X, L, ...,
                             eps = NULL, dimyx = NULL, xy = NULL,
                             delta=NULL)

  ## S3 method for class 'linfun'
as.linim(X, L=domain(X), ...,
                            eps = NULL, dimyx = NULL, xy = NULL,
                            delta=NULL)

Arguments

X

Data to be converted to a pixel image on a linear network.

L

Linear network (object of class "linnet").

...

Additional arguments passed to X when X is a function.

eps,dimyx,xy

Optional arguments passed to as.mask to control the pixel resolution.

delta

Optional. Numeric value giving the approximate distance (in coordinate units) between successive sample points along each segment of the network.

Details

This function converts the data X into a pixel image on a linear network, an object of class "linim" (see linim).

The argument X may be any of the following:

First X is converted to a pixel image object Y (object of class "im"). The conversion is performed by as.im. The arguments eps, dimyx and xy determine the pixel resolution.

Next Y is converted to a pixel image on a linear network using linim. The argument L determines the linear network. If L is missing or NULL, then X should be an object of class "linim", and L defaults to the linear network on which X is defined.

In addition to converting the function to a pixel image, the algorithm also generates a fine grid of sample points evenly spaced along each segment of the network (with spacing at most delta coordinate units). The function values at these sample points are stored in the resulting object as a data frame (the argument df of linim). This mechanism allows greater accuracy for some calculations (such as integral.linim).

Value

An image object on a linear network; an object of class "linim".

Author(s)

\spatstatAuthors

See Also

as.im

Examples

1
2
  f <- function(x,y){ x + y }
  plot(as.linim(f, simplenet))

spatstat.linnet documentation built on July 17, 2021, 9:07 a.m.