R: Pixel Values Along a Transect

transect.im {spatstat} | R Documentation

## Pixel Values Along a Transect

### Description

Extract the pixel values of a pixel image at each point along a linear transect.

### Usage

    transect.im(X, ..., from="bottomleft", to="topright",
                 click=FALSE, add=FALSE)

### Arguments

`X` | A pixel image (object of class `"im"`).
`...` | Ignored.
`from,to` | Optional. Start point and end point of the transect. Pairs of (x,y) coordinates in a format acceptable to `xy.coords`, or keywords `"bottom"`, `"left"`, `"top"`, `"right"`, `"bottomleft"` etc.
`click` | Optional. Logical value. If `TRUE`, the linear transect is determined interactively by the user, who clicks two points on the current plot.
`add` | Logical. If `click=TRUE`, this argument determines whether to perform interactive tasks on the current plot (`add=TRUE`) or to start by plotting `X` (`add=FALSE`).

### Details

The pixel values of the image `X` along a line segment will be extracted. The result is a function table (`"fv"` object) which can be plotted directly.

If `click=TRUE`, then the user is prompted to click two points on the plot of `X`. These endpoints define the transect.

Otherwise, the transect is defined by the endpoints `from` and `to`. The default is a diagonal transect from bottom left to top right of the frame.

### Value

An object of class `"fv"` which can be plotted.

### Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au

and Rolf Turner r.turner@auckland.ac.nz

### See Also

`im`

### Examples

      Z <- density(redwood)
      plot(transect.im(Z))
      ## Not run:
       if(FALSE) {
        plot(transect.im(Z, click=TRUE))
       }

    ## End(Not run)

[Package spatstat version 1.54-0 Index]