diff --git a/NAMESPACE b/NAMESPACE index 8908f0edc2d3ef1e7818e92ca245f468ef390517..983a892656c807ef4ad315c44301d6aca22c2894 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -52,7 +52,6 @@ import(rainfarmr) import(s2dverification) import(stats) importFrom(ClimProjDiags,SelBox) -importFrom(ClimProjDiags,Subset) importFrom(RColorBrewer,brewer.pal) importFrom(abind,abind) importFrom(data.table,CJ) diff --git a/NEWS.md b/NEWS.md index 7e18054c35af3a206a714b06fba694b7185cc1dd..92ad49b15e6eb43f3efc4e27c2e361fe35ed1dc7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,7 +9,7 @@ - Fixes: + PlotForecastPDF correctly displays terciles labels - + + CST_SaveExp correctly save time units ### CSTools 3.1.0 **Submission date to CRAN: 02-07-2020** diff --git a/R/CST_SaveExp.R b/R/CST_SaveExp.R index b98f3668b3316260c9e28b9a4658b795566b68c5..1bdd4779b6ae20158815a660e7ff61cc2f8845e4 100644 --- a/R/CST_SaveExp.R +++ b/R/CST_SaveExp.R @@ -24,7 +24,7 @@ #'\dontrun{ #'library(CSTools) #'data <- lonlat_data$exp -#'destination <- "./path/" +#'destination <- "./path2/" #'CST_SaveExp(data = data, destination = destination) #'} #' @@ -256,9 +256,10 @@ SaveExp <- function(data, lon, lat, Dataset, var_name, units, startdates, Dates, dim_names <- names(dim(data)) if (any(dim_names != c('longitude', 'latitude', 'member', 'time'))) { data <- Reorder(data, c('longitude', 'latitude', 'member', 'time')) - } - dim_time <- ncdim_def(name = 'time', units = 'days since 1970-01-01', - vals = as.numeric(Dates), + } + differ <- as.numeric((Dates - Dates[1])/3600) + dim_time <- ncdim_def(name = 'time', units = paste('hours since', Dates[1]), + vals = differ, calendar = 'proleptic_gregorian', longname = 'time', unlim = TRUE) list_pos = length(dims_var) + 1 dims_var[[list_pos]] <- dim_time diff --git a/man/CST_SaveExp.Rd b/man/CST_SaveExp.Rd index 0e49c11955488a64772269976f01ed95919f4af3..ddd9164e1c9d88e284d4653d1b05941699e2adf4 100644 --- a/man/CST_SaveExp.Rd +++ b/man/CST_SaveExp.Rd @@ -25,7 +25,7 @@ This function allows to divide and save a object of class \dontrun{ library(CSTools) data <- lonlat_data$exp -destination <- "./path/" +destination <- "./path2/" CST_SaveExp(data = data, destination = destination) }