checkDim | R Documentation |
Checks that the input grids have the same lon/lat shape
The function simply compares the size of the dimension across input grids for structural consistency of their respective data arrays. It does not make any additional checks on the metadata, so equal array shapes do not entail full temporal/spatial consistency.
checkDim(..., dimensions = c("var", "member", "time", "lat", "lon"))
... |
Input grids to be compared |
dimension |
Character vector. Dimensions to check for consistency. Several dimensions can be tested at once.
Possible values are: |
In case of spatial inconsistency of any of the inputs grids, the function stops the execution of the current expression, with an error message.
J Bedia
getShape
Other check.helpers:
checkGrid()
,
checkSeason()
,
checkTemporalConsistency()
,
checkVarNames()
require(climate4R.datasets)
data("VALUE_Iberia_tas")
data("VALUE_Iberia_pr")
checkDim(VALUE_Iberia_tas, VALUE_Iberia_pr) # ok, go on
data("EOBS_Iberia_tas")
data("EOBS_Iberia_pr")
checkDim(EOBS_Iberia_tas, EOBS_Iberia_pr) # ok, go on
data("NCEP_Iberia_psl")
try(checkDim(EOBS_Iberia_tas, EOBS_Iberia_pr, NCEP_Iberia_psl)) # inconsistent dimensions
data("CFS_Iberia_tas")
try(checkDim(NCEP_Iberia_psl, CFS_Iberia_tas, dimensions = "member"))
checkDim(VALUE_Iberia_tas, VALUE_Iberia_pr) # ok, go on
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.