Shrink a point pattern, or expand it through replication.

1 2 3 |

`plants` |
A spatstat point pattern object (class |

`width` |
Distance from the edges to shrink, if negative, or to expand, if positive. |

`distance` |
Distance from the edges. |

When computing assimilation or competition indices, those near the edges of the study region are distorted because the outside is empty. Common solutions to this problem are not to use indices computed for plants near the edges, or (with rectangular regions) to attach translated copies, thus changing the topology into a torus. This function implements both strategies. When expanding, the part of the copies to be used can be specified to avoid unnecessary computation.

Typically, in the first case the indices are computed for the full pattern, and then the edges are discarded using `edges`

with a negative `width`

. In the second case, the point pattern is first expanded with `edges(plants, width)`

, the indices are computed for the expanded pattern, and then the result is restricted to the original size with `edges(result, -width)`

.

`core`

returns a logical vector indicating which plants are at more than the given distance from the edges. With a negative `width`

, `edges(plants, width)`

is the same as `plants[core(plants, -width)]`

.

`edges`

returns a point pattern with the same structure as `plants`

.

If `width`

is negative, the parts of the pattern that are at a distance less than `-width`

from an edge are discarded.

If `width`

is positive, the pattern is first expanded by surrounding it with 8 shifted copies (the window must be rectangular). Then, the parts of the pattern that are at a distance less than `width`

from an edge of the enlarged pattern are discarded.

If `width`

= 0, `plants`

is returned unchanged.

`core`

returns a logical vector with `TRUE`

for the plants that are at more than the given distance from the edges, and `FALSE`

otherwise.

Requires the spatstat package.

Oscar GarcĂa.

http://forestgrowth.unbc.ca/siplab

1 2 3 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.