Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

geoTS (version 0.1.8)

matrixToRaster: Creates a RasterLayer object from a matrix

Description

Transforms a matrix into a RasterLayer object.

Usage

matrixToRaster(matrix, raster = NULL, projection = NULL)

Value

A RasterLayer

Arguments

matrix

a matrix object. See Details.

raster

a RasterLayer object whose extent and projection are used to create a raster from matrix.

projection

a character vector providing a coordinate reference system. Required when ncol(matrix)=3.

Details

When ncol(matrix)=3, this function assumes that the first two columns of argument matrix provide coordinates to create a RasterLayer, hence argument projection must be provided. When argument matrix has only 2 columns, then the argument raster must be provided because its coordinates and projection will be used to rasterize matrix.

See Also