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

Description Usage Arguments Value Examples

View source: R/aux_fun.R

Description

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

Usage

1
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

1
2
3
4
5
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"))

imarkonis/csa documentation built on May 18, 2020, 10:49 a.m.