create_torus: Pad a raster by a specified radius

View source: R/create_torus.R

create_torusR Documentation

Pad a raster by a specified radius

Description

This function pads a raster by a specified number of cells, creating the effect of a torus. This function is intended for use on simulated landscapes, in order to avoid edge effects

Usage

create_torus(dat, dpad)

Arguments

dat

The raster dataset to pad

dpad

The amount by which to pad the raster (in the same units as the raster)

Details

A torus is an infinite surface where the top joins the bottom, and the left side meets the right side. See https://en.wikipedia.org/wiki/Torus for a full mathematical description.

In this function, the torus effect is achieved by adding the specified number of rows of the top of the raster to the bottom (and vice versa) and the specified number of rows of the right of the raster to the left (and vice versa)

Value

raster. Original raster padded by r cells with torus effect (see Details)

Examples

data(cat_ls)
d <- create_torus(dat = cat_ls, dpad = 5)

laurajanegraham/winmoveR documentation built on June 4, 2023, 3:15 p.m.