extract_window: Extracts relevant window from raster based on position of...

View source: R/extract_window.R

extract_windowR Documentation

Extracts relevant window from raster based on position of central pixel and window size

Description

Extracts relevant window from raster based on position of central pixel and window size

Usage

extract_window(r, w = c(3, 3), idx)

Arguments

r

a raster

w

A vector of length 2 specifying the dimensions of the rectangular window to use where the first number is the number of rows and the second number is the number of columns. Window size must be an odd number. If a single value is supplied it will be used for both the number of rows and columns.

idx

A vector of length 2 representing the row and column position of the central pixel of the window you wish to extract from raster r

Value

A matrix containg the extracted window around the central pixel from raster r


ailich/mytools documentation built on Jan. 7, 2023, 11:16 a.m.