checkSeason: Seasonal check

View source: R/helpers.R

checkSeasonR Documentation

Seasonal check

Description

Check the consistency of seasons across the input grids

Usage

checkSeason(...)

Arguments

...

Input grids to be compared

Value

In case of seasonal inconsistency of any of the inputs grids, the function stops the execution of the current expression, with an error message.

Author(s)

J Bedia

See Also

getSeason

Other check.helpers: checkDim(), checkGrid(), checkTemporalConsistency(), checkVarNames()

Examples

 
require(climate4R.datasets)
data("EOBS_Iberia_tas")
data("EOBS_Iberia_pr")
grid1 <- subsetGrid(EOBS_Iberia_tas, season = 1)
grid2 <- subsetGrid(EOBS_Iberia_pr, season = 1)
checkSeason(grid1, grid2) # ok, go on
try(checkSeason(grid1, grid2, EOBS_Iberia_tas)) # oops
# However note that it is insensitive to the level of temporal aggregation:
agg <- aggregateGrid(EOBS_Iberia_tas, aggr.m = list(FUN = "mean", na.rm = TRUE))
identical(getSeason(agg), getSeason(EOBS_Iberia_tas))
checkSeason(agg, EOBS_Iberia_tas)

#Station data
data("VALUE_Iberia_tas")
data("VALUE_Iberia_pr")
checkSeason(VALUE_Iberia_tas, VALUE_Iberia_pr)


SantanderMetGroup/transformeR documentation built on Nov. 25, 2024, 1:25 p.m.