diff --git a/R/RMS.R b/R/RMS.R index b3188fcd045518458cec57415c4bcd7da3b5621a..2c77d0a818e5794af3074137b59ad0e181aa87d0 100644 --- a/R/RMS.R +++ b/R/RMS.R @@ -255,8 +255,10 @@ RMS <- function(exp, obs, time_dim = 'sdate', dat_dim = 'dataset', # Remove nexp and nobs if dat_dim = NULL if (is.null(dat_dim)) { dim(rms) <- NULL - dim(conf.lower) <- NULL - dim(conf.upper) <- NULL + if (conf) { + dim(conf.lower) <- NULL + dim(conf.upper) <- NULL + } } ################################### diff --git a/tests/testthat/test-RMS.R b/tests/testthat/test-RMS.R index f69cfd8a1de8e4db627dcfb5e9d0e0ca2a845080..aac0672547c71a1a94dc56332f0d4c44f97af905 100644 --- a/tests/testthat/test-RMS.R +++ b/tests/testthat/test-RMS.R @@ -205,6 +205,10 @@ test_that("4. Output checks: dat3", { c(1.6458118, 0.8860392, 0.8261295, 1.1681939, 2.1693538, 1.3064454, 0.5384229, 1.1215333), tolerance = 0.00001 ) + expect_equal( + dim(RMS(exp3, obs3, dat_dim = NULL, conf = FALSE)$rms), + c(ftime = 2, lon = 1, lat = 4) + ) }) ############################################## \ No newline at end of file