Learn R Programming

rcaiman (version 1.2.2)

crop_caim: 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)

Value

SpatRaster

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.

Examples

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

Run the code above in your browser using DataLab