redim | R Documentation |
Add missing dimensions to the 'Data' array as singletons. For internal usage mainly.
redim(
grid,
member = TRUE,
runtime = FALSE,
var = FALSE,
time = TRUE,
loc = FALSE,
drop = FALSE
)
member |
logical. Add 'member' dimension (default = TRUE) |
runtime |
logical. Add 'runtime' dimension (default = FALSE) |
var |
logical. Add 'var' dimension (default = FALSE) |
loc |
logical. Only if |
drop |
logical. Drop dimensions of length = 1 (default = FALSE) |
obj |
A regular or irregular (e.g. station data) grid |
The function does not handle multigrids (i.e. "var"
dimension).
Thus, multigrids need to be subsetted along "var"
prior to redimensioning via subsetGrid
.
The same object with all the dimensions (i.e. member, time, loc)
M. Iturbide, J. Bedia
Other internal.helpers:
array3Dto2Dmat()
,
array3Dto2Dmat.stations()
,
bindGrid.member()
,
bindGrid.spatial()
,
bindGrid.time()
,
grid3Dto2Dmatrix()
,
mat2Dto3Darray.stations()
,
sortDim.spatial()
,
sortDim.time()
require(climate4R.datasets)
data("EOBS_Iberia_tas")
getShape(EOBS_Iberia_tas)
a <- redim(EOBS_Iberia_tas)
getShape(a)
b <- redim(EOBS_Iberia_tas, var = TRUE)
getShape(b)
# This one is probably never needed, but for illustration:
y <- redim(EOBS_Iberia_tas, member = FALSE, var = TRUE)
getShape(y)
# 'drop = TRUE' performs the reverse operation:
z <- redim(b, drop = TRUE)
getShape(z)
# Example with station data
data("VALUE_Iberia_pr")
getShape(VALUE_Iberia_pr)
# By default, the internal data array is converted to the time.lat-lon structure.
# This is a conveninet behaviour for internal usage:
getShape(redim(VALUE_Iberia_pr, member = TRUE))
# Use the argument 'loc=TRUE' to avoid this behaviour:
getShape(redim(VALUE_Iberia_pr, member = TRUE, loc = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.