Learn R Programming

gecko (version 1.0.2)

spectrify: Make a raster layer SPECTRE compatible

Description

Transform a given raster object to the resolution, datum, projection and extent used in SPECTRE.

Usage

spectrify(layers, continuous = TRUE, filepath = NULL)

Value

SpatRaster.

Arguments

layers

SpatRaster. A raster object that you would like to be SPECTRE compatible.

continuous

logical. Whether the data present in layers is continuous. If TRUE bilinear interpolation will be used in the case of resampling and reprojection. if FALSE nearest neighbour will be used instead. See terra::resample() for more information on interpolation methods.

filepath

character. Optional file path to where the final raster layer should be saved, in the format "folder/file.tif". If filepath is NULL your layer will be saved to your current working directory.

Examples

Run this code
if (FALSE) {
# For the sake of demonstration we will transform our raster layer "range".
distribution = gecko.data("range")
standard_dist = spectrify(distribution)
terra::plot(standard_dist)
}

Run the code above in your browser using DataLab