crop_caim: Crop a canopy image from a file

View source: R/crop_caim.R

crop_caimR Documentation

Crop a canopy image from a file

Description

Function that complements read_caim() and read_caim_raw()

Usage

crop_caim(r, upper_left = NULL, width = NULL, height = NULL)

Arguments

r

SpatRaster

upper_left

An integer vector of length two. The pixels coordinates of the upper left corner of a region of interest (ROI). These coordinates should be in the raster coordinates system. This system works like a spreadsheet, i.e, when going down through the vertical axis, the row number increases (IMPORTANT: column and row must be provided instead of row and column, as is the norm for objects from the class data.frame and others alike)

width, height

An integer vector of length one. The size of the boxy ROI whose upper left corner is the upper_left argument.

Value

SpatRaster

Examples

caim <- read_caim()
ncell(caim)
caim <- crop_caim(caim, c(231,334), 15, 10)
ncell(caim)

rcaiman documentation built on Nov. 15, 2023, 1:08 a.m.