diff --git a/R/AbsToProbs.R b/R/AbsToProbs.R index 89c72c929ad34477e787b5099ea4e2f125998b92..a11506e80ae7fc31d7bd37b200a978b0d396d28b 100644 --- a/R/AbsToProbs.R +++ b/R/AbsToProbs.R @@ -31,7 +31,9 @@ #'@return An 's2dv_cube' object containing the probabilites in the element \code{data}. #' #'@examples -#'exp <- CSTools::lonlat_prec +#'exp <- NULL +#'exp$data <- array(rnorm(216), dim = c(dataset = 1, member = 2, sdate = 3, ftime = 9, lat = 2, lon = 2)) +#'class(exp) <- 's2dv_cube' #'exp_probs <- CST_AbsToProbs(exp) #'exp$data <- array(rnorm(5 * 3 * 214 * 2), #' c(member = 5, sdate = 3, ftime = 214, lon = 2)) @@ -115,7 +117,7 @@ CST_AbsToProbs <- function(data, start = NULL, end = NULL, #'probabilites in the element \code{data}. #' #'@examples -#'exp <- CSTools::lonlat_prec$data +#'exp <- array(rnorm(216), dim = c(dataset = 1, member = 2, sdate = 3, ftime = 9, lat = 2, lon = 2)) #'exp_probs <- AbsToProbs(exp) #'data <- array(rnorm(5 * 2 * 61 * 1), #' c(member = 5, sdate = 2, ftime = 61, lon = 1)) diff --git a/R/AccumulationExceedingThreshold.R b/R/AccumulationExceedingThreshold.R index cceb07beb433bf5c00aeb0e5842091aba447234d..ae08c0d41fcdfa983bf68944433c1a067a783f1b 100644 --- a/R/AccumulationExceedingThreshold.R +++ b/R/AccumulationExceedingThreshold.R @@ -41,8 +41,9 @@ #'@return A 's2dv_cube' object containing the indicator in the element \code{data}. #' #'@examples -#'exp <- CSTools::lonlat_data$exp -#'exp$data <- CSTools::lonlat_data$exp$data[1, 5, 3, 3, 1, 1] +#'exp <- NULL +#'exp$data <- array(rnorm(216)*200, dim = c(dataset = 1, member = 2, sdate = 3, ftime = 9, lat = 2, lon = 2)) +#'class(exp) <- 's2dv_cube' #'DOT <- CST_AccumulationExceedingThreshold(exp, threshold = 280) #' #'@import multiApply diff --git a/R/MergeRefToExp.R b/R/MergeRefToExp.R index 068acfe00c7fabfdeae621da2918922f58103da5..216dc8e831a8448909a7f1e2284519e216e660e2 100644 --- a/R/MergeRefToExp.R +++ b/R/MergeRefToExp.R @@ -44,15 +44,17 @@ #' seq(as.Date("01-07-1994", "%d-%m-%Y", tz = 'UTC'), #' as.Date("01-12-1994","%d-%m-%Y", tz = 'UTC'), "day")) #'dim(data_dates) <- c(ftime = 154, sdate = 2) +#'data <- NULL +#'data$data <- array(1:(2*154*2), c(ftime = 154, sdate = 2, member= 2)) +#'data$Dates$start <- data_dates +#'class(data) <- 's2dv_cube' #'ref_dates <- seq(as.Date("01-01-1993", "%d-%m-%Y", tz = 'UTC'), #' as.Date("01-12-1994","%d-%m-%Y", tz = 'UTC'), "day") #'dim(ref_dates) <- c(ftime = 350, sdate = 2) -#'ref <- array(1001:1700, c(ftime = 350, sdate = 2)) -#'data <- array(1:(2*154*2), c(ftime = 154, sdate = 2, member= 2)) -#'ref <- CSTools::s2dv_cube(data = ref, Dates = list(start = ref_dates, -#' end = ref_dates)) -#'data <- CSTools::s2dv_cube(data = data, Dates = list(start = data_dates, -#' end = data_dates)) +#'ref <- NULL +#'ref$data <- array(1001:1700, c(ftime = 350, sdate = 2)) +#'ref$Dates$start <- ref_dates +#'class(ref) <- 's2dv_cube' #'new_data <- CST_MergeRefToExp(data1 = ref, data2 = data, #' start1 = list(21, 6), end1 = list(30, 6), #' start2 = list(1, 7), end2 = list(21, 9)) @@ -111,7 +113,7 @@ CST_MergeRefToExp <- function(data1, data2, start1, end1, start2, end2, # TO DO CONCATENATE DATES res <- Apply(list(dates1, dates2), target_dims = time_dim, c, output_dims = time_dim, ncores = ncores)$output1 - if (class(data1$Dates[[1]]) == 'Date') { + if (inherits(data1$Dates[[1]], 'Date')) { data1$Dates <- as.Date(res, origin = '1970-01-01') } else { data1$Dates <- as.POSIXct(res*3600*24, origin = '1970-01-01', tz = 'UTC') diff --git a/R/PeriodAccumulation.R b/R/PeriodAccumulation.R index ab093be28c7f58ddc1315ea9ab5e41a11de9f241..c64672debe443ffe5ad97618b5f3940c727a2af9 100644 --- a/R/PeriodAccumulation.R +++ b/R/PeriodAccumulation.R @@ -34,7 +34,9 @@ #'\code{data}. #' #'@examples -#'exp <- CSTools::lonlat_prec +#'exp <- NULL +#'exp$data <- array(rnorm(216)*200, dim = c(dataset = 1, member = 2, sdate = 3, ftime = 9, lat = 2, lon = 2)) +#'class(exp) <- 's2dv_cube' #'TP <- CST_PeriodAccumulation(exp) #'exp$data <- array(rnorm(5 * 3 * 214 * 2), #' c(memb = 5, sdate = 3, ftime = 214, lon = 2)) @@ -123,7 +125,7 @@ CST_PeriodAccumulation <- function(data, start = NULL, end = NULL, #'indicator in the element \code{data}. #' #'@examples -#'exp <- CSTools::lonlat_prec$data +#'exp <- array(rnorm(216)*200, dim = c(dataset = 1, member = 2, sdate = 3, ftime = 9, lat = 2, lon = 2)) #'TP <- PeriodAccumulation(exp, time_dim = 'ftime') #'data <- array(rnorm(5 * 3 * 214 * 2), #' c(memb = 5, sdate = 3, time = 214, lon = 2)) diff --git a/R/PeriodMean.R b/R/PeriodMean.R index 55f28cd70a030ef1d2570c05879950e9dcc02e59..97f99c3c309dad36392a23d214148c188a3d1290 100644 --- a/R/PeriodMean.R +++ b/R/PeriodMean.R @@ -34,8 +34,13 @@ #' \code{data}. #' #'@examples -#'exp <- CSTools::lonlat_data$exp -#'exp$data <- CSTools::lonlat_data$exp$data[1, , 3, , 1, 1] +#'exp <- NULL +#'exp$data <- array(rnorm(45), dim = c(member = 7, ftime = 8)) +#'class(exp) <- 's2dv_cube' +#'exp$Dates$start <- c(seq(as.Date("01-07-1993", "%d-%m-%Y", tz = 'UTC'), +#' as.Date("01-08-1993","%d-%m-%Y", tz = 'UTC'), "day"), +#' seq(as.Date("01-07-1994", "%d-%m-%Y", tz = 'UTC'), +#' as.Date("01-08-1994","%d-%m-%Y", tz = 'UTC'), "day")) #'SA <- CST_PeriodMean(exp) #' #'@import multiApply @@ -111,7 +116,7 @@ CST_PeriodMean <- function(data, start = NULL, end = NULL, #'indicator in the element \code{data}. #' #'@examples -#'exp <- CSTools::lonlat_prec$data +#'exp <- array(rnorm(56), dim = c(member = 7, ftime = 8)) #'SA <- PeriodMean(exp, time_dim = 'ftime') #' #'@import multiApply diff --git a/R/QThreshold.R b/R/QThreshold.R index 46634113f818ae3de7dd37e29db8c2627e323288..8eb950a76a255138e5c930c3a2d4f0414496c605 100644 --- a/R/QThreshold.R +++ b/R/QThreshold.R @@ -53,7 +53,9 @@ #' #'@examples #'threshold <- 26 -#'exp <- CSTools::lonlat_prec +#'exp <- NULL +#'exp$data <- array(abs(rnorm(112)*26), dim = c(member = 7, sdate = 8, ftime = 2)) +#'class(exp) <- 's2dv_cube' #'exp_probs <- CST_QThreshold(exp, threshold) #'exp$data <- array(rnorm(5 * 3 * 214 * 2), #' c(member = 5, sdate = 3, ftime = 214, lon = 2)) @@ -63,7 +65,7 @@ #' as.Date("30-11-2001", format = "%d-%m-%Y"), by = 'day'), #' seq(as.Date("01-05-2002", format = "%d-%m-%Y"), #' as.Date("30-11-2002", format = "%d-%m-%Y"), by = 'day')) -#'exp_probs <- CST_QThreshold(exp, threshold, start = list(21, 4), end = list(21, 6)) +#'exp_probs <- CST_QThreshold(exp, threshold) #' #'@import multiApply #'@importFrom ClimProjDiags Subset diff --git a/R/SelectPeriodOnData.R b/R/SelectPeriodOnData.R index 49575a2d9bf4361b3a14647a290815055f76711c..3c162dd746340feb909a9a19ea615ee9081a94a1 100644 --- a/R/SelectPeriodOnData.R +++ b/R/SelectPeriodOnData.R @@ -21,15 +21,16 @@ #'\code{data$data} during the period requested from \code{start} to \code{end}. #' #'@examples -#'exp <- CSTools::lonlat_prec +#'exp <- NULL #'exp$data <- array(rnorm(5 * 3 * 214 * 2), #' c(memb = 5, sdate = 3, ftime = 214, lon = 2)) -#'exp$Dates[[1]] <- c(seq(as.Date("01-05-2000", format = "%d-%m-%Y"), +#'exp$Dates$start <- c(seq(as.Date("01-05-2000", format = "%d-%m-%Y"), #' as.Date("30-11-2000", format = "%d-%m-%Y"), by = 'day'), #' seq(as.Date("01-05-2001", format = "%d-%m-%Y"), #' as.Date("30-11-2001", format = "%d-%m-%Y"), by = 'day'), #' seq(as.Date("01-05-2002", format = "%d-%m-%Y"), #' as.Date("30-11-2002", format = "%d-%m-%Y"), by = 'day')) +#'class(exp) <- 's2dv_cube' #'Period <- CST_SelectPeriodOnData(exp, start = list(21, 6), end = list(21, 9)) #' #'@import multiApply diff --git a/R/Threshold.R b/R/Threshold.R index 18b8dea19f1f546afa57a6cc4abe630a76bdd08e..0117952a9ece29ca03caa68b1880c836455016e7 100644 --- a/R/Threshold.R +++ b/R/Threshold.R @@ -38,16 +38,16 @@ #' #'@examples #'threshold <- 0.9 -#'exp <- CSTools::lonlat_prec -#'exp_probs <- CST_Threshold(exp, threshold) +#'exp <- NULL #'exp$data <- array(rnorm(5 * 3 * 214 * 2), #' c(member = 5, sdate = 3, ftime = 214, lon = 2)) -#'exp$Dates[[1]] <- c(seq(as.Date("01-05-2000", format = "%d-%m-%Y"), +#'exp$Dates$start <- c(seq(as.Date("01-05-2000", format = "%d-%m-%Y"), #' as.Date("30-11-2000", format = "%d-%m-%Y"), by = 'day'), #' seq(as.Date("01-05-2001", format = "%d-%m-%Y"), #' as.Date("30-11-2001", format = "%d-%m-%Y"), by = 'day'), #' seq(as.Date("01-05-2002", format = "%d-%m-%Y"), #' as.Date("30-11-2002", format = "%d-%m-%Y"), by = 'day')) +#'class(exp) <- 's2dv_cube' #'exp_probs <- CST_Threshold(exp, threshold, start = list(21, 4), end = list(21, 6)) #' #'@import multiApply diff --git a/R/TotalSpellTimeExceedingThreshold.R b/R/TotalSpellTimeExceedingThreshold.R index 7039f28d21b7e133b8510590ba94a1c94398d4e4..ac2261ae3380e12245fbbb705ac2535fa95fcc8e 100644 --- a/R/TotalSpellTimeExceedingThreshold.R +++ b/R/TotalSpellTimeExceedingThreshold.R @@ -45,9 +45,16 @@ #'\code{data}. #' #'@examples -#'exp <- CSTools::lonlat_data$exp -#'exp$data <- array(rnorm(5 * 3 * 20 * 2, mean = 25, sd = 3), -#' c(member = 5, sdate = 3, ftime = 20, lon = 2)) +#'exp <- NULL +#'exp$data <- array(rnorm(5 * 3 * 214 * 2)*23, +#' c(member = 5, sdate = 3, ftime = 214, lon = 2)) +#'exp$Dates$start <- c(seq(as.Date("01-05-2000", format = "%d-%m-%Y"), +#' as.Date("30-11-2000", format = "%d-%m-%Y"), by = 'day'), +#' seq(as.Date("01-05-2001", format = "%d-%m-%Y"), +#' as.Date("30-11-2001", format = "%d-%m-%Y"), by = 'day'), +#' seq(as.Date("01-05-2002", format = "%d-%m-%Y"), +#' as.Date("30-11-2002", format = "%d-%m-%Y"), by = 'day')) +#'class(exp) <- 's2dv_cube' #'TTSET <- CST_TotalSpellTimeExceedingThreshold(exp, threshold = 23, spell = 3) #' #'@import multiApply diff --git a/R/TotalTimeExceedingThreshold.R b/R/TotalTimeExceedingThreshold.R index 6e6e72d907a9efc21e8b54d4572a412f91542e7d..ec25244d879adf3cd6d561e3b4aff5a6bc31bfbd 100644 --- a/R/TotalTimeExceedingThreshold.R +++ b/R/TotalTimeExceedingThreshold.R @@ -50,8 +50,16 @@ #'\code{data}. #' #'@examples -#'exp <- CSTools::lonlat_data$exp -#'exp$data <- CSTools::lonlat_data$exp$data[1, 1, 3, 3, 1, 1] +#'exp <- NULL +#'exp$data <- array(abs(rnorm(5 * 3 * 214 * 2)*280), +#' c(member = 5, sdate = 3, ftime = 214, lon = 2)) +#'exp$Dates$start <- c(seq(as.Date("01-05-2000", format = "%d-%m-%Y"), +#' as.Date("30-11-2000", format = "%d-%m-%Y"), by = 'day'), +#' seq(as.Date("01-05-2001", format = "%d-%m-%Y"), +#' as.Date("30-11-2001", format = "%d-%m-%Y"), by = 'day'), +#' seq(as.Date("01-05-2002", format = "%d-%m-%Y"), +#' as.Date("30-11-2002", format = "%d-%m-%Y"), by = 'day')) +#'class(exp) <- 's2dv_cube' #'DOT <- CST_TotalTimeExceedingThreshold(exp, threshold = 280) #' #'@import multiApply @@ -147,7 +155,8 @@ CST_TotalTimeExceedingThreshold <- function(data, threshold, op = '>', #'indicator in the element \code{data}. #' #'@examples -#'exp <- CSTools::lonlat_data$exp$data[1, 5, 3, 3, 1, 1] +#'exp <- array(abs(rnorm(5 * 3 * 214 * 2)*280), +#' c(member = 5, sdate = 3, ftime = 214, lon = 2)) #'DOT <- TotalTimeExceedingThreshold(exp, threshold = 300, time_dim = 'ftime') #' #'@import multiApply diff --git a/man/AbsToProbs.Rd b/man/AbsToProbs.Rd index 89b1f8346120fbf5c9a6d954b8accc724fb01ba0..9b79296bfa5b152c6c75bbac08b05bf33828a1ac 100644 --- a/man/AbsToProbs.Rd +++ b/man/AbsToProbs.Rd @@ -59,7 +59,7 @@ probabilities of each value in the ensemble. If multiple initializations Distribution Function excluding the corresponding initialization. } \examples{ -exp <- CSTools::lonlat_prec$data +exp <- array(rnorm(216), dim = c(dataset = 1, member = 2, sdate = 3, ftime = 9, lat = 2, lon = 2)) exp_probs <- AbsToProbs(exp) data <- array(rnorm(5 * 2 * 61 * 1), c(member = 5, sdate = 2, ftime = 61, lon = 1)) diff --git a/man/CST_AbsToProbs.Rd b/man/CST_AbsToProbs.Rd index dcdcef9ebd8c3428f56a437c81e1e8c1eeb28ba1..fe58b51622db027bf4f69accf18031fe0aaec640 100644 --- a/man/CST_AbsToProbs.Rd +++ b/man/CST_AbsToProbs.Rd @@ -54,7 +54,9 @@ probabilities of each value in the ensemble. If multiple initializations Distribution Function excluding the corresponding initialization. } \examples{ -exp <- CSTools::lonlat_prec +exp <- NULL +exp$data <- array(rnorm(216), dim = c(dataset = 1, member = 2, sdate = 3, ftime = 9, lat = 2, lon = 2)) +class(exp) <- 's2dv_cube' exp_probs <- CST_AbsToProbs(exp) exp$data <- array(rnorm(5 * 3 * 214 * 2), c(member = 5, sdate = 3, ftime = 214, lon = 2)) diff --git a/man/CST_AccumulationExceedingThreshold.Rd b/man/CST_AccumulationExceedingThreshold.Rd index 0754c249fa2d63a68dafbffdd7da7571dae90e26..4fb563a99ea575c02ca0373ea8201883c2957768 100644 --- a/man/CST_AccumulationExceedingThreshold.Rd +++ b/man/CST_AccumulationExceedingThreshold.Rd @@ -68,8 +68,9 @@ function: } } \examples{ -exp <- CSTools::lonlat_data$exp -exp$data <- CSTools::lonlat_data$exp$data[1, 5, 3, 3, 1, 1] +exp <- NULL +exp$data <- array(rnorm(216)*200, dim = c(dataset = 1, member = 2, sdate = 3, ftime = 9, lat = 2, lon = 2)) +class(exp) <- 's2dv_cube' DOT <- CST_AccumulationExceedingThreshold(exp, threshold = 280) } diff --git a/man/CST_MergeRefToExp.Rd b/man/CST_MergeRefToExp.Rd index 102b0620bb2deb804be43ad56ca2a14aa43292c6..a5b9cc76fa4e73595a865eac4998bc2c417b3772 100644 --- a/man/CST_MergeRefToExp.Rd +++ b/man/CST_MergeRefToExp.Rd @@ -72,15 +72,17 @@ data_dates <- c(seq(as.Date("01-07-1993", "\%d-\%m-\%Y", tz = 'UTC'), seq(as.Date("01-07-1994", "\%d-\%m-\%Y", tz = 'UTC'), as.Date("01-12-1994","\%d-\%m-\%Y", tz = 'UTC'), "day")) dim(data_dates) <- c(ftime = 154, sdate = 2) +data <- NULL +data$data <- array(1:(2*154*2), c(ftime = 154, sdate = 2, member= 2)) +data$Dates$start <- data_dates +class(data) <- 's2dv_cube' ref_dates <- seq(as.Date("01-01-1993", "\%d-\%m-\%Y", tz = 'UTC'), as.Date("01-12-1994","\%d-\%m-\%Y", tz = 'UTC'), "day") dim(ref_dates) <- c(ftime = 350, sdate = 2) -ref <- array(1001:1700, c(ftime = 350, sdate = 2)) -data <- array(1:(2*154*2), c(ftime = 154, sdate = 2, member= 2)) -ref <- CSTools::s2dv_cube(data = ref, Dates = list(start = ref_dates, - end = ref_dates)) -data <- CSTools::s2dv_cube(data = data, Dates = list(start = data_dates, - end = data_dates)) +ref <- NULL +ref$data <- array(1001:1700, c(ftime = 350, sdate = 2)) +ref$Dates$start <- ref_dates +class(ref) <- 's2dv_cube' new_data <- CST_MergeRefToExp(data1 = ref, data2 = data, start1 = list(21, 6), end1 = list(30, 6), start2 = list(1, 7), end2 = list(21, 9)) diff --git a/man/CST_PeriodAccumulation.Rd b/man/CST_PeriodAccumulation.Rd index afd6080a4f6aa7dc6bf7596e684169d2a6a7a1d6..d1bf476b063191e0957c876486aed1f4fdbab559 100644 --- a/man/CST_PeriodAccumulation.Rd +++ b/man/CST_PeriodAccumulation.Rd @@ -55,7 +55,9 @@ by using this function: } } \examples{ -exp <- CSTools::lonlat_prec +exp <- NULL +exp$data <- array(rnorm(216)*200, dim = c(dataset = 1, member = 2, sdate = 3, ftime = 9, lat = 2, lon = 2)) +class(exp) <- 's2dv_cube' TP <- CST_PeriodAccumulation(exp) exp$data <- array(rnorm(5 * 3 * 214 * 2), c(memb = 5, sdate = 3, ftime = 214, lon = 2)) diff --git a/man/CST_PeriodMean.Rd b/man/CST_PeriodMean.Rd index c4e3dae8e25be517c9c82bebfa8196f552cdf36c..b9ae538ee38a6bdd51e03fa09e7be58925211964 100644 --- a/man/CST_PeriodMean.Rd +++ b/man/CST_PeriodMean.Rd @@ -55,8 +55,13 @@ this function: } } \examples{ -exp <- CSTools::lonlat_data$exp -exp$data <- CSTools::lonlat_data$exp$data[1, , 3, , 1, 1] +exp <- NULL +exp$data <- array(rnorm(45), dim = c(member = 7, ftime = 8)) +class(exp) <- 's2dv_cube' +exp$Dates$start <- c(seq(as.Date("01-07-1993", "\%d-\%m-\%Y", tz = 'UTC'), + as.Date("01-08-1993","\%d-\%m-\%Y", tz = 'UTC'), "day"), + seq(as.Date("01-07-1994", "\%d-\%m-\%Y", tz = 'UTC'), + as.Date("01-08-1994","\%d-\%m-\%Y", tz = 'UTC'), "day")) SA <- CST_PeriodMean(exp) } diff --git a/man/CST_QThreshold.Rd b/man/CST_QThreshold.Rd index a01c5d2293ef3d7368a9fc26938a7a74ab87e70d..0edbcba89a4e3a3ff57c7c5b4d090f6859c38185 100644 --- a/man/CST_QThreshold.Rd +++ b/man/CST_QThreshold.Rd @@ -79,7 +79,9 @@ and memb_dim parameters: } \examples{ threshold <- 26 -exp <- CSTools::lonlat_prec +exp <- NULL +exp$data <- array(abs(rnorm(112)*26), dim = c(member = 7, sdate = 8, ftime = 2)) +class(exp) <- 's2dv_cube' exp_probs <- CST_QThreshold(exp, threshold) exp$data <- array(rnorm(5 * 3 * 214 * 2), c(member = 5, sdate = 3, ftime = 214, lon = 2)) @@ -89,6 +91,6 @@ exp$Dates[[1]] <- c(seq(as.Date("01-05-2000", format = "\%d-\%m-\%Y"), as.Date("30-11-2001", format = "\%d-\%m-\%Y"), by = 'day'), seq(as.Date("01-05-2002", format = "\%d-\%m-\%Y"), as.Date("30-11-2002", format = "\%d-\%m-\%Y"), by = 'day')) -exp_probs <- CST_QThreshold(exp, threshold, start = list(21, 4), end = list(21, 6)) +exp_probs <- CST_QThreshold(exp, threshold) } diff --git a/man/CST_SelectPeriodOnData.Rd b/man/CST_SelectPeriodOnData.Rd index 210fcaaf10c1feff92eae5b084b15606621cb4eb..6e041624af16a773bbfa7a32a6a06ca55aca3f60 100644 --- a/man/CST_SelectPeriodOnData.Rd +++ b/man/CST_SelectPeriodOnData.Rd @@ -34,15 +34,16 @@ A 's2dv_cube' object containing the subset of the object Auxiliary function to subset data for a specific period. } \examples{ -exp <- CSTools::lonlat_prec +exp <- NULL exp$data <- array(rnorm(5 * 3 * 214 * 2), c(memb = 5, sdate = 3, ftime = 214, lon = 2)) -exp$Dates[[1]] <- c(seq(as.Date("01-05-2000", format = "\%d-\%m-\%Y"), +exp$Dates$start <- c(seq(as.Date("01-05-2000", format = "\%d-\%m-\%Y"), as.Date("30-11-2000", format = "\%d-\%m-\%Y"), by = 'day'), seq(as.Date("01-05-2001", format = "\%d-\%m-\%Y"), as.Date("30-11-2001", format = "\%d-\%m-\%Y"), by = 'day'), seq(as.Date("01-05-2002", format = "\%d-\%m-\%Y"), as.Date("30-11-2002", format = "\%d-\%m-\%Y"), by = 'day')) +class(exp) <- 's2dv_cube' Period <- CST_SelectPeriodOnData(exp, start = list(21, 6), end = list(21, 9)) } diff --git a/man/CST_Threshold.Rd b/man/CST_Threshold.Rd index 906d1b18d2e985d7e8b4b28ca27840f84ffcfc0a..5d260e9cb656f205a5d67339b573fdfd1627285b 100644 --- a/man/CST_Threshold.Rd +++ b/man/CST_Threshold.Rd @@ -65,16 +65,16 @@ given a dataset. } \examples{ threshold <- 0.9 -exp <- CSTools::lonlat_prec -exp_probs <- CST_Threshold(exp, threshold) +exp <- NULL exp$data <- array(rnorm(5 * 3 * 214 * 2), c(member = 5, sdate = 3, ftime = 214, lon = 2)) -exp$Dates[[1]] <- c(seq(as.Date("01-05-2000", format = "\%d-\%m-\%Y"), +exp$Dates$start <- c(seq(as.Date("01-05-2000", format = "\%d-\%m-\%Y"), as.Date("30-11-2000", format = "\%d-\%m-\%Y"), by = 'day'), seq(as.Date("01-05-2001", format = "\%d-\%m-\%Y"), as.Date("30-11-2001", format = "\%d-\%m-\%Y"), by = 'day'), seq(as.Date("01-05-2002", format = "\%d-\%m-\%Y"), as.Date("30-11-2002", format = "\%d-\%m-\%Y"), by = 'day')) +class(exp) <- 's2dv_cube' exp_probs <- CST_Threshold(exp, threshold, start = list(21, 4), end = list(21, 6)) } diff --git a/man/CST_TotalSpellTimeExceedingThreshold.Rd b/man/CST_TotalSpellTimeExceedingThreshold.Rd index d19415e81fcf96a35ed116f956bce64fec5b67d9..847fed25a2a4a66c22b918f3e7c23b2ea84833b6 100644 --- a/man/CST_TotalSpellTimeExceedingThreshold.Rd +++ b/man/CST_TotalSpellTimeExceedingThreshold.Rd @@ -69,9 +69,16 @@ using function \code{Threshold} or the data can be transform into probabilites by using function \code{AbsToProbs}. See section @examples. } \examples{ -exp <- CSTools::lonlat_data$exp -exp$data <- array(rnorm(5 * 3 * 20 * 2, mean = 25, sd = 3), - c(member = 5, sdate = 3, ftime = 20, lon = 2)) +exp <- NULL +exp$data <- array(rnorm(5 * 3 * 214 * 2)*23, + c(member = 5, sdate = 3, ftime = 214, lon = 2)) +exp$Dates$start <- c(seq(as.Date("01-05-2000", format = "\%d-\%m-\%Y"), + as.Date("30-11-2000", format = "\%d-\%m-\%Y"), by = 'day'), + seq(as.Date("01-05-2001", format = "\%d-\%m-\%Y"), + as.Date("30-11-2001", format = "\%d-\%m-\%Y"), by = 'day'), + seq(as.Date("01-05-2002", format = "\%d-\%m-\%Y"), + as.Date("30-11-2002", format = "\%d-\%m-\%Y"), by = 'day')) +class(exp) <- 's2dv_cube' TTSET <- CST_TotalSpellTimeExceedingThreshold(exp, threshold = 23, spell = 3) } diff --git a/man/CST_TotalTimeExceedingThreshold.Rd b/man/CST_TotalTimeExceedingThreshold.Rd index 980d77b2b85f7bbb0d8b0f6d099053861c40528c..bbd05e04b7091c524e7468a754644d5c21ba3e1b 100644 --- a/man/CST_TotalTimeExceedingThreshold.Rd +++ b/man/CST_TotalTimeExceedingThreshold.Rd @@ -75,8 +75,16 @@ indices for heat stress can be obtained by using this function: } } \examples{ -exp <- CSTools::lonlat_data$exp -exp$data <- CSTools::lonlat_data$exp$data[1, 1, 3, 3, 1, 1] +exp <- NULL +exp$data <- array(abs(rnorm(5 * 3 * 214 * 2)*280), + c(member = 5, sdate = 3, ftime = 214, lon = 2)) +exp$Dates$start <- c(seq(as.Date("01-05-2000", format = "\%d-\%m-\%Y"), + as.Date("30-11-2000", format = "\%d-\%m-\%Y"), by = 'day'), + seq(as.Date("01-05-2001", format = "\%d-\%m-\%Y"), + as.Date("30-11-2001", format = "\%d-\%m-\%Y"), by = 'day'), + seq(as.Date("01-05-2002", format = "\%d-\%m-\%Y"), + as.Date("30-11-2002", format = "\%d-\%m-\%Y"), by = 'day')) +class(exp) <- 's2dv_cube' DOT <- CST_TotalTimeExceedingThreshold(exp, threshold = 280) } diff --git a/man/PeriodAccumulation.Rd b/man/PeriodAccumulation.Rd index f6e6d3b324a56923b84b3e82ef500b4caf46d8e9..c589b9b7072633783ba05e66986ca4f2fb4e1beb 100644 --- a/man/PeriodAccumulation.Rd +++ b/man/PeriodAccumulation.Rd @@ -59,7 +59,7 @@ by using this function: } } \examples{ -exp <- CSTools::lonlat_prec$data +exp <- array(rnorm(216)*200, dim = c(dataset = 1, member = 2, sdate = 3, ftime = 9, lat = 2, lon = 2)) TP <- PeriodAccumulation(exp, time_dim = 'ftime') data <- array(rnorm(5 * 3 * 214 * 2), c(memb = 5, sdate = 3, time = 214, lon = 2)) diff --git a/man/PeriodMean.Rd b/man/PeriodMean.Rd index 803a3f2fd1dc7b6c1b0e06f72796496fa2a41192..fffb332299a35a3a67e7fe274059628d592e7d5a 100644 --- a/man/PeriodMean.Rd +++ b/man/PeriodMean.Rd @@ -59,7 +59,7 @@ this function: } } \examples{ -exp <- CSTools::lonlat_prec$data +exp <- array(rnorm(56), dim = c(member = 7, ftime = 8)) SA <- PeriodMean(exp, time_dim = 'ftime') } diff --git a/man/TotalTimeExceedingThreshold.Rd b/man/TotalTimeExceedingThreshold.Rd index 524f93855a83aa7a55683c74ecd10adb2a62ee06..f874b50a3eac4e58a3d15ca287fe782c7e8c8176 100644 --- a/man/TotalTimeExceedingThreshold.Rd +++ b/man/TotalTimeExceedingThreshold.Rd @@ -78,7 +78,8 @@ be obtained by using this function: } } \examples{ -exp <- CSTools::lonlat_data$exp$data[1, 5, 3, 3, 1, 1] +exp <- array(abs(rnorm(5 * 3 * 214 * 2)*280), + c(member = 5, sdate = 3, ftime = 214, lon = 2)) DOT <- TotalTimeExceedingThreshold(exp, threshold = 300, time_dim = 'ftime') }