checkVarNames | R Documentation |
Check the consistency of variable (short)names across grids/multigrids
checkVarNames(..., check.order = TRUE)
... |
Input grids to be compared |
check.order |
Check if the order is consistent across input grids. This is the default. When set to
|
In case of inconsistency of any of the inputs grids, the function stops the execution of the current expression, with an error message.
J Bedia
getVarNames
Other check.helpers:
checkDim()
,
checkGrid()
,
checkSeason()
,
checkTemporalConsistency()
require(climate4R.datasets)
data("NCEP_Iberia_hus850", "NCEP_Iberia_psl", "NCEP_Iberia_ta850")
#' # Testing grids that contain different variables:
try(checkVarNames(NCEP_Iberia_hus850, NCEP_Iberia_psl))
# Testing multigrid contents:
mg <- makeMultiGrid(NCEP_Iberia_hus850, NCEP_Iberia_psl, NCEP_Iberia_ta850)
mg1 <- makeMultiGrid(NCEP_Iberia_hus850, NCEP_Iberia_ta850, NCEP_Iberia_psl)
mg2 <- makeMultiGrid(NCEP_Iberia_ta850, NCEP_Iberia_psl, NCEP_Iberia_hus850)
# The input grids contains the same variables, but their ordering is different:
checkVarNames(mg, mg1, mg2, check.order = FALSE) # OK
# If we do check.order = TRUE (the default), it gives an error:
try(checkVarNames(mg, mg1, mg2, check.order = TRUE)) # Error
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.