dt.to.brick: Transform data.table to brick

View source: R/aux_fun.R

dt.to.brickR Documentation

Transform data.table to brick

Description

The function dt.to.brick transforms a data.table object to brick (raster) format

Usage

dt.to.brick(dt, var_name)

Arguments

dt

The data table object to be transformed. It must be in a four-column format, with the coordinate columns named as "lat" & "lon" and time values as "time".

var_name

The name (chr) of the column in the data table (dt) which holds the values of the variable, e.g., "temperature".

Value

dt as a brick object.

Examples

## Not run: 
aa <- expand.grid(lat = seq(40, 50, 1),
                 lon = seq(20, 30, 1),
                 time = seq(1900, 2000, 1))
aa$anomaly = rnorm(nrow(aa))
aa <- brick(dt.to.brick(aa, "anomaly"))

## End(Not run)

csa documentation built on Oct. 24, 2023, 5:07 p.m.

Related to dt.to.brick in csa...