Learn R Programming

spatstat.linnet (version 3.4-0)

as.linim: Convert to Pixel Image on Linear Network

Description

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

Usage

as.linim(X, ...)

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

# S3 method for linfun as.linim(X, L=domain(X), ..., eps = NULL, dimyx = NULL, xy = NULL, rule.eps=c("adjust.eps", "grow.frame", "shrink.frame"), delta=NULL, nd=NULL)

# S3 method for function as.linim(X, L, ..., eps = NULL, dimyx = NULL, xy = NULL, rule.eps=c("adjust.eps", "grow.frame", "shrink.frame"), delta=NULL, nd=NULL)

# S3 method for default as.linim(X, L, ..., eps = NULL, dimyx = NULL, xy = NULL, rule.eps=c("adjust.eps", "grow.frame", "shrink.frame"), delta=NULL, nd=NULL)

Arguments

Value

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

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:

  • a function on a linear network, an object of class "linfun".

  • a pixel image on a linear network, an object of class "linim".

  • a pixel image, an object of class "im".

  • a function(x,y) in the R language.

  • any type of data acceptable to as.im, such as a function, numeric value, or window.

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, xy and rule.eps 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. 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). If L is a "linim" object, then it is used as a template; the sample points are determined by the sample points in L. Otherwise, L is treated as a network (class "linnet"), and new sample points are constructed by placing them evenly-spaced along each segment of the network with separation delta.

See Also

as.im

Examples

Run this code
  f <- function(x,y){ x + y }
  plot(as.linim(f, simplenet))

Run the code above in your browser using DataLab