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

Description Usage Arguments Details Value Author(s) See Also

View source: R/array3Dto2Dmat.R


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.





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


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


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


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 Nov. 23, 2019, 12:28 p.m.