TimeRastVariable
is a data class that is based on a 3D array. It has two "macro" dimensions, time and spatial. But due to the raster spatial has two dimension, the data class actually has three data-dimensions: (time, x, y).TimeRastArray
is a data class that is based on a 4D array. It has three "macro" dimensions: time, spatial, and variable. But due to the raster spatial has two dimension, the data class actually has four data-dimensions: (time, x, y, variable).
Usage
new_TimeRastVariable(data_, Name_, Unit_, Time_, ...)
# S3 method for SpatRaster
new_TimeRastVariable(data_, Name_, Unit_, Time_, ...)
# S3 method for array
new_TimeRastVariable(data_, Name_, Unit_, Time_, Spat_EPSG, Spat_extent, ...)
new_TimeRastArray(data_, Name_, Unit_, Time_, ...)
# S3 method for SpatRaster
new_TimeRastArray(data_, Name_, Unit_, Time_, dim_Time_Vari = c(1, 2), ...)
# S3 method for array
new_TimeRastArray(data_, Name_, Unit_, Time_, Spat_EPSG, Spat_extent, ...)
Arguments
- data_
(num-array or terra::SpatRaster)
3D (array) for
new_TimeRastVariable.array()
, it must in the (time, x, y) dimension-order, use the functionaperm()
to adjust the dimension-order4D (array) for
new_TimeRastArray.array()
, it must in the (time, x, y, variable) dimension-order, use the functionaperm()
to adjust the dimension-order(terra::SpatRaster) (multilayer) for
new_TimeRastVariable.SpatRaster()
andnew_TimeRastArray.SpatRaster()
, created byterra::rast()
- Name_, Unit_
(char or vector of char) name and unit of Variable,
Unit_
should beunits::as_units()
- Time_
(vector of lubridate::timepoint) time dimension, created by
lubridate::as_date()
orlubridate::as_datetime()
- ...
other parameters
- Spat_EPSG
(integer) EPSG code of the CRS (Coordinate Reference System)
- Spat_extent
(vector of numric), extension of the Raster in c(xmin, xmax, ymin, ymax), it can be projected east- and north-meter or global longitude- and latitude-degree
- dim_Time_Vari
the order of time- and variable-dimenion in the layer of
terra::rast
, it must bec(1, 2)
: first time then variable orc(2, 1)
: first variable then time,default is
c(1, 2)