diff --git a/R/Utils.R b/R/Utils.R index 4460018139d3bf55bfd8cc3f9b1b2a4f6f17f850..9dfcaa7337a39e6546fa77cf6cfa717b37d836af 100644 --- a/R/Utils.R +++ b/R/Utils.R @@ -206,7 +206,11 @@ if (Sys.which("cdo")[[1]] == "") { stop("Error: CDO libraries not available") } - cdo_version <- as.numeric_version(strsplit(suppressWarnings(system2("cdo", args = '-V', stderr = TRUE))[[1]], ' ')[[1]][5]) + + cdo_version <- strsplit(suppressWarnings(system2("cdo", args = '-V', stderr = TRUE))[[1]], ' ')[[1]][5] + + cdo_version <- as.numeric_version(unlist(strsplit(cdo_version, "[A-Za-z]", fixed = FALSE))[[1]]) + } # If the variable to load is 2-d, we need to determine whether: # - interpolation is needed