R: S3 Group Generic Methods for Images on a Linear Network

Math.linim {spatstat.linnet} | R Documentation

## S3 Group Generic Methods for Images on a Linear Network

### Description

These are group generic methods for images of class `"linim"`, which allows for usual mathematical functions and operators to be applied directly to pixel images on a linear network. See Details for a list of implemented functions.

### Usage

    ## S3 methods for group generics have prototypes:
    Math(x, ...)
    Ops(e1, e2)
    Complex(z)
    Summary(..., na.rm = FALSE)

### Arguments

`x, z, e1, e2` | objects of class `"linim"`.
`...` | further arguments passed to methods.
`na.rm` | logical: should missing values be removed?

### Details

An object of class `"linim"` represents a pixel image on a linear network. See `linim`.

Below is a list of mathematical functions and operators which are defined for these images. Not all functions will make sense for all types of images. For example, none of the functions in the `"Math"` group make sense for character-valued images. Note that the `"Ops"` group methods are implemented using `eval.linim`.

1. Group `"Math"`:

   - `abs`, `sign`, `sqrt`,
     `floor`, `ceiling`, `trunc`,
     `round`, `signif`

   - `exp`, `log`, `expm1`, `log1p`,
     `cos`, `sin`, `tan`,
     `cospi`, `sinpi`, `tanpi`,
     `acos`, `asin`, `atan`

     `cosh`, `sinh`, `tanh`,
     `acosh`, `asinh`, `atanh`

   - `lgamma`, `gamma`, `digamma`, `trigamma`

   - `cumsum`, `cumprod`, `cummax`, `cummin`

2. Group `"Ops"`:

   - `"+"`, `"-"`, `"*"`, `"/"`, `"^"`, `"%%"`, `"%/%"`

   - `"&"`, `"|"`, `"!"`

   - `"=="`, `"!="`, `"<"`, `"<="`, `">="`, `">"`

3. Group `"Summary"`:

   - `all`, `any`

   - `sum`, `prod`

   - `min`, `max`

   - `range`

4. Group `"Complex"`:

   - `Arg`, `Conj`, `Im`, `Mod`, `Re`

### Value

The return value is another object of class `"linim"`, except in the following cases: `all` and `any` return a single logical value; `sum`, `prod`, `min` and `max` return a single numerical value; `range` returns a vector of two numerical values.

### 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

`eval.linim` for evaluating expressions involving images.

### Examples

      fx <- function(x,y,seg,tp) { (x - y)^2 }
      fL <- linfun(fx, simplenet)
      Z <- as.linim(fL)
      A <- Z+2
      A <- -Z
      A <- sqrt(Z)
      A <- !(Z > 0.1)

[Package spatstat.linnet version 2.0-0 Index]