pad_raster: pad_raster

Description Usage Arguments Details Value Examples

Description

Adding padding to raster

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
pad_raster(landscape, pad_raster_value, pad_raster_cells, global,
  return_raster, to_disk)

## S3 method for class 'RasterLayer'
pad_raster(landscape, pad_raster_value = -999,
  pad_raster_cells = 1, global = FALSE, return_raster = TRUE,
  to_disk = getOption("to_disk", default = FALSE))

## S3 method for class 'RasterStack'
pad_raster(landscape, pad_raster_value = -999,
  pad_raster_cells = 1, global = FALSE, return_raster = TRUE,
  to_disk = getOption("to_disk", default = FALSE))

## S3 method for class 'RasterBrick'
pad_raster(landscape, pad_raster_value = -999,
  pad_raster_cells = 1, global = FALSE, return_raster = TRUE,
  to_disk = getOption("to_disk", default = FALSE))

## S3 method for class 'stars'
pad_raster(landscape, pad_raster_value = -999,
  pad_raster_cells = 1, global = FALSE, return_raster = TRUE,
  to_disk = getOption("to_disk", default = FALSE))

## S3 method for class 'list'
pad_raster(landscape, pad_raster_value = -999,
  pad_raster_cells = 1, global = FALSE, return_raster = TRUE,
  to_disk = getOption("to_disk", default = FALSE))

## S3 method for class 'matrix'
pad_raster(landscape, pad_raster_value = -999,
  pad_raster_cells = 1, global = FALSE, return_raster = TRUE,
  to_disk = getOption("to_disk", default = FALSE))

Arguments

landscape

Raster* Layer, Stack, Brick or a list of rasterLayers.

pad_raster_value

Value of cells added

pad_raster_cells

Number of rows and columns added

global

Only pad around the raster extent or also NA holes "inside"

return_raster

If false, matrix is returned

to_disk

Logical argument, if FALSE results of get_patches are hold in memory. If true, pad_raster writes temporary files and hence, does not hold everything in memory. Can be set with a global option, e.g. option(to_disk = TRUE).

Details

Adds equally (in all four directions) additional cells around the raster

Value

raster

Examples

1
pad_raster(landscape, pad_raster_value = -1, pad_raster_cells = 2)

r-spatialecology/landscapemetrics documentation built on May 20, 2019, noon