diff --git a/modules/Loading/Loading.R b/modules/Loading/Loading.R index 53d41cc24efa32c4f4d7247aca245e8eb5888676..a6b185d24c5e6332a143dc62c4ab3f60e0931dd0 100644 --- a/modules/Loading/Loading.R +++ b/modules/Loading/Loading.R @@ -291,7 +291,7 @@ load_datasets <- function(recipe) { # Check for consistency between hcst and obs grid if (!(recipe$Analysis$Regrid$type == 'none')) { - if (!identical(as.vector(hcst$lat), as.vector(obs$lat))) { + if (!isTRUE(all.equal(as.vector(hcst$lat), as.vector(obs$lat)))) { lat_error_msg <- paste("Latitude mismatch between hcst and obs.", "Please check the original grids and the", "regrid parameters in your recipe.") @@ -304,7 +304,7 @@ load_datasets <- function(recipe) { info(recipe$Run$logger, obs_lat_msg) stop("hcst and obs don't share the same latitudes.") } - if (!identical(as.vector(hcst$lon), as.vector(obs$lon))) { + if (!isTRUE(all.equal(as.vector(hcst$lon), as.vector(obs$lon)))) { lon_error_msg <- paste("Longitude mismatch between hcst and obs.", "Please check the original grids and the", "regrid parameters in your recipe.") diff --git a/modules/Loading/Loading_decadal.R b/modules/Loading/Loading_decadal.R index 0a95d9a47b2cdd5ae69ed8c8caffd86546c4b6eb..e3677e1db3bceae19bfa8e3c27493575a43a00f6 100644 --- a/modules/Loading/Loading_decadal.R +++ b/modules/Loading/Loading_decadal.R @@ -387,7 +387,7 @@ load_datasets <- function(recipe) { # lat and lon attributes if (!(recipe$Analysis$Regrid$type == 'none')) { - if (!identical(as.vector(hcst$lat), as.vector(obs$lat))) { + if (!isTRUE(all.equal(as.vector(hcst$lat), as.vector(obs$lat)))) { lat_error_msg <- paste("Latitude mismatch between hcst and obs.", "Please check the original grids and the", "regrid parameters in your recipe.") @@ -401,7 +401,7 @@ load_datasets <- function(recipe) { stop("hcst and obs don't share the same latitudes.") } - if (!identical(as.vector(hcst$lon), as.vector(obs$lon))) { + if (!isTRUE(all.equal(as.vector(hcst$lon), as.vector(obs$lon)))) { lon_error_msg <- paste("Longitude mismatch between hcst and obs.", "Please check the original grids and the", "regrid parameters in your recipe.")