array3Dto2Dmat: Conversion of a 3D array to a 2D matrix

View source: R/array3Dto2Dmat.R

array3Dto2DmatR Documentation

Conversion of a 3D array to a 2D matrix

Description

Converts 3D arrays of the form [lon,lat,time] -not strictly in this order-, to 2D matrices of the form [time, grid-point], in this order. Mainly for PCA analysis.

Usage

array3Dto2Dmat(array3D)

Arguments

array3D

A 3-dimensional array with longitude, latitude and time dimensions

Details

The function is intended to convert grids to a convenient format for PCA-related analyses. The columns are ordered in X and Y ascending order, with coordinate Y varying faster. Thus, column coordinates would be given by the expression: expand.grid(gridData$xyCoords$y, gridData$xyCoords$x)[2:1]. This is the most convenient format in order to naturally fill a matrix with the adequate number of columns (longitudes) and rows (latitudes) given the vectorized value of the output at a given time (or after time-averaging via rowMeans). The function is insensitive to the dimension ordering of the input data array

Value

A 2-dimensional matrix with time in rows and grid-points in columns.

Author(s)

M. de Felice, J Bedia

See Also

mat2Dto3Darray, which performs the inverse operation

Other internal.helpers: array3Dto2Dmat.stations(), bindGrid.member(), bindGrid.spatial(), bindGrid.time(), grid3Dto2Dmatrix(), mat2Dto3Darray.stations(), redim(), sortDim.spatial(), sortDim.time()


SantanderMetGroup/transformeR documentation built on Oct. 28, 2023, 5:26 a.m.