From bd84633f56cd53752ee802592f5318ed0d087a79 Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Mon, 7 Aug 2023 11:11:59 +0200 Subject: [PATCH 1/4] Add reference in function MergeRefToExp --- R/MergeRefToExp.R | 23 ++++++++++++++++++----- man/CST_MergeRefToExp.Rd | 25 ++++++++++++++++++++----- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/R/MergeRefToExp.R b/R/MergeRefToExp.R index 03425c8..3cd9d96 100644 --- a/R/MergeRefToExp.R +++ b/R/MergeRefToExp.R @@ -9,6 +9,11 @@ #'1st the forecast covers until the beginning of June next year), a climatology #'(or other references) could be added at the end of the forecast lead time to #'cover the desired period (e.g.: until the end of summer). +#' +#'This function is created to merge observations and forecasts in the +#'bioclimatic indicator structure, known as the ‘blending’ strategy (see +#'references). This key strategy aims to increase users’ confidence in the +#'reformed predictions. #' #'@param data1 An 's2dv_cube' object with the element 'data' being a #' multidimensional array with named dimensions. All dimensions must be @@ -50,11 +55,19 @@ #'common to both arrays and for the 'time_dim' dimension, the sum of the #'corresponding dimension of 'data1' and 'data2'. If 'memb_dim' is not null, #'regarding member dimension, two different situations can occur: (1) in the -#'case that one of the arrays does not have member dimension or is equal to 1, -#'the result will contain the repeated values of itself; (2) in the case that -#'both arrays have member dimension and is greater than 1, all combinations of -#'member dimension will be returned. The other elements of the 's2dv_cube' will -#'be updated with the combined information of both datasets. +#'case that one of the arrays does not have member dimension or is equal to 1 +#'and the other array has multiple member dimension, the result will contain the +#'repeated values of the array one up to the lenght of member dimension of array +#'two; (2) in the case that both arrays have member dimension and is greater +#'than 1, all combinations of member dimension will be returned. The other +#'elements of the 's2dv_cube' will be updated with the combined information of +#'both datasets. +#' +#'@references Chou, C., R. Marcos-Matamoros, L. Palma Garcia, N. Pérez-Zanón, +#'M. Teixeira, S. Silva, N. Fontes, A. Graça, A. Dell'Aquila, S. Calmanti and +#'N. González-Reviriego (2023). Advanced seasonal predictions for vine +#'management based on bioclimatic indicators tailored to the wine sector. +#'Climate Services, 30, 100343, \doi{doi.org/10.1016/j.cliser.2023.100343}. #' #'@examples #'data_dates <- c(seq(as.Date("01-07-1993", "%d-%m-%Y", tz = 'UTC'), diff --git a/man/CST_MergeRefToExp.Rd b/man/CST_MergeRefToExp.Rd index bbca8c4..5ab328b 100644 --- a/man/CST_MergeRefToExp.Rd +++ b/man/CST_MergeRefToExp.Rd @@ -67,11 +67,13 @@ the following dimensions: the original dimensions of the input data, which are common to both arrays and for the 'time_dim' dimension, the sum of the corresponding dimension of 'data1' and 'data2'. If 'memb_dim' is not null, regarding member dimension, two different situations can occur: (1) in the -case that one of the arrays does not have member dimension or is equal to 1, -the result will contain the repeated values of itself; (2) in the case that -both arrays have member dimension and is greater than 1, all combinations of -member dimension will be returned. The other elements of the 's2dv_cube' will -be updated with the combined information of both datasets. +case that one of the arrays does not have member dimension or is equal to 1 +and the other array has multiple member dimension, the result will contain the +repeated values of the array one up to the lenght of member dimension of array +two; (2) in the case that both arrays have member dimension and is greater +than 1, all combinations of member dimension will be returned. The other +elements of the 's2dv_cube' will be updated with the combined information of +both datasets. } \description{ Some indicators are defined for specific temporal periods (e.g.: summer from @@ -84,6 +86,12 @@ period because it is initialized too early (e.g.: Initialization on November (or other references) could be added at the end of the forecast lead time to cover the desired period (e.g.: until the end of summer). } +\details{ +This function is created to merge observations and forecasts in the +bioclimatic indicator structure, known as the ‘blending’ strategy (see +references). This key strategy aims to increase users’ confidence in the +reformed predictions. +} \examples{ data_dates <- c(seq(as.Date("01-07-1993", "\%d-\%m-\%Y", tz = 'UTC'), as.Date("01-12-1993","\%d-\%m-\%Y", tz = 'UTC'), "day"), @@ -106,3 +114,10 @@ new_data <- CST_MergeRefToExp(data1 = ref, data2 = data, start2 = list(1, 7), end2 = list(21, 9)) } +\references{ +Chou, C., R. Marcos-Matamoros, L. Palma Garcia, N. Pérez-Zanón, +M. Teixeira, S. Silva, N. Fontes, A. Graça, A. Dell'Aquila, S. Calmanti and +N. González-Reviriego (2023). Advanced seasonal predictions for vine +management based on bioclimatic indicators tailored to the wine sector. +Climate Services, 30, 100343, \doi{doi.org/10.1016/j.cliser.2023.100343}. +} -- GitLab From c28af1f408eb869ebb9a77f78e35bc45dadb70e9 Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Mon, 7 Aug 2023 11:21:18 +0200 Subject: [PATCH 2/4] Correct modification of documentation --- R/MergeRefToExp.R | 20 ++++++++++++++++---- man/MergeRefToExp.Rd | 22 ++++++++++++++++++---- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/R/MergeRefToExp.R b/R/MergeRefToExp.R index 3cd9d96..898f32e 100644 --- a/R/MergeRefToExp.R +++ b/R/MergeRefToExp.R @@ -233,6 +233,11 @@ CST_MergeRefToExp <- function(data1, data2, start1 = NULL, end1 = NULL, #'1st the forecast covers until the beginning of June next year), a climatology #'(or other references) could be added at the end of the forecast lead time to #'cover the desired period (e.g.: until the end of summer). +#' +#'This function is created to merge observations and forecasts in the +#'bioclimatic indicator structure, known as the ‘blending’ strategy (see +#'references). This key strategy aims to increase users’ confidence in the +#'reformed predictions. #' #'@param data1 A multidimensional array with named dimensions. All dimensions #' must be equal to 'data2' dimensions except for the ones specified with @@ -278,10 +283,17 @@ CST_MergeRefToExp <- function(data1, data2, start1 = NULL, end1 = NULL, #'the 'time_dim' dimension, the sum of the corresponding dimension of 'data1' #'and 'data2'. If 'memb_dim' is not null, regarding member dimension, two #'different situations can occur: (1) in the case that one of the arrays does -#'not have member dimension or is equal to 1, the result will contain the -#'repeated values of itself; (2) in the case that both arrays have member -#'dimension and is greater than 1, all combinations of member dimension will be -#'returned. +#'not have member dimension or is equal to 1 and the other array has multiple +#'member dimension, the result will contain the repeated values of the array one +#'up to the lenght of member dimension of array two; (2) in the case that both +#'arrays have member dimension and is greater than 1, all combinations of member +#'dimension will be returned. +#' +#'@references Chou, C., R. Marcos-Matamoros, L. Palma Garcia, N. Pérez-Zanón, +#'M. Teixeira, S. Silva, N. Fontes, A. Graça, A. Dell'Aquila, S. Calmanti and +#'N. González-Reviriego (2023). Advanced seasonal predictions for vine +#'management based on bioclimatic indicators tailored to the wine sector. +#'Climate Services, 30, 100343, \doi{doi.org/10.1016/j.cliser.2023.100343}. #' #'@examples #'data_dates <- c(seq(as.Date("01-07-1993", "%d-%m-%Y", tz = 'UTC'), diff --git a/man/MergeRefToExp.Rd b/man/MergeRefToExp.Rd index e22b52d..047ad37 100644 --- a/man/MergeRefToExp.Rd +++ b/man/MergeRefToExp.Rd @@ -74,10 +74,11 @@ original dimensions of the input data, which are common to both arrays and for the 'time_dim' dimension, the sum of the corresponding dimension of 'data1' and 'data2'. If 'memb_dim' is not null, regarding member dimension, two different situations can occur: (1) in the case that one of the arrays does -not have member dimension or is equal to 1, the result will contain the -repeated values of itself; (2) in the case that both arrays have member -dimension and is greater than 1, all combinations of member dimension will be -returned. +not have member dimension or is equal to 1 and the other array has multiple +member dimension, the result will contain the repeated values of the array one +up to the lenght of member dimension of array two; (2) in the case that both +arrays have member dimension and is greater than 1, all combinations of member +dimension will be returned. } \description{ Some indicators are defined for specific temporal periods (e.g.: summer from @@ -90,6 +91,12 @@ period because it is initialized too early (e.g.: Initialization on November (or other references) could be added at the end of the forecast lead time to cover the desired period (e.g.: until the end of summer). } +\details{ +This function is created to merge observations and forecasts in the +bioclimatic indicator structure, known as the ‘blending’ strategy (see +references). This key strategy aims to increase users’ confidence in the +reformed predictions. +} \examples{ data_dates <- c(seq(as.Date("01-07-1993", "\%d-\%m-\%Y", tz = 'UTC'), as.Date("01-12-1993","\%d-\%m-\%Y", tz = 'UTC'), "day"), @@ -107,3 +114,10 @@ new_data <- MergeRefToExp(data1 = ref, dates1 = ref_dates, start1 = list(21, 6), time_dim = 'ftime') } +\references{ +Chou, C., R. Marcos-Matamoros, L. Palma Garcia, N. Pérez-Zanón, +M. Teixeira, S. Silva, N. Fontes, A. Graça, A. Dell'Aquila, S. Calmanti and +N. González-Reviriego (2023). Advanced seasonal predictions for vine +management based on bioclimatic indicators tailored to the wine sector. +Climate Services, 30, 100343, \doi{doi.org/10.1016/j.cliser.2023.100343}. +} -- GitLab From a1a0e733a3ea8a8a4bace93ccc73d7d990c2a8fa Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Wed, 6 Sep 2023 17:08:06 +0200 Subject: [PATCH 3/4] Correct description of the blending strategy in the documentation --- R/MergeRefToExp.R | 10 ++++++---- man/CST_MergeRefToExp.Rd | 9 +++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/R/MergeRefToExp.R b/R/MergeRefToExp.R index 898f32e..e47c988 100644 --- a/R/MergeRefToExp.R +++ b/R/MergeRefToExp.R @@ -10,10 +10,12 @@ #'(or other references) could be added at the end of the forecast lead time to #'cover the desired period (e.g.: until the end of summer). #' -#'This function is created to merge observations and forecasts in the -#'bioclimatic indicator structure, known as the ‘blending’ strategy (see -#'references). This key strategy aims to increase users’ confidence in the -#'reformed predictions. +#'This function is created to merge observations and forecasts, known as the +#'‘blending’ strategy (see references). The basis for this strategy is that the +#'predictions are progressively replaced with observational data as soon as they +#'become available (i.e., when entering the indicator definition period). This +#'key strategy aims to increase users’ confidence in the reformed predictions. + #' #'@param data1 An 's2dv_cube' object with the element 'data' being a #' multidimensional array with named dimensions. All dimensions must be diff --git a/man/CST_MergeRefToExp.Rd b/man/CST_MergeRefToExp.Rd index 5ab328b..a49c9dc 100644 --- a/man/CST_MergeRefToExp.Rd +++ b/man/CST_MergeRefToExp.Rd @@ -87,10 +87,11 @@ period because it is initialized too early (e.g.: Initialization on November cover the desired period (e.g.: until the end of summer). } \details{ -This function is created to merge observations and forecasts in the -bioclimatic indicator structure, known as the ‘blending’ strategy (see -references). This key strategy aims to increase users’ confidence in the -reformed predictions. +This function is created to merge observations and forecasts, known as the +‘blending’ strategy (see references). The basis for this strategy is that the +predictions are progressively replaced with observational data as soon as they +become available (i.e., when entering the indicator definition period). This +key strategy aims to increase users’ confidence in the reformed predictions. } \examples{ data_dates <- c(seq(as.Date("01-07-1993", "\%d-\%m-\%Y", tz = 'UTC'), -- GitLab From ad62916c481398adba43e32a9c8977cf42deb725 Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Wed, 6 Sep 2023 17:09:25 +0200 Subject: [PATCH 4/4] Correct changes in documentation --- R/MergeRefToExp.R | 10 +++++----- man/MergeRefToExp.Rd | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/R/MergeRefToExp.R b/R/MergeRefToExp.R index e47c988..f5d9069 100644 --- a/R/MergeRefToExp.R +++ b/R/MergeRefToExp.R @@ -15,7 +15,6 @@ #'predictions are progressively replaced with observational data as soon as they #'become available (i.e., when entering the indicator definition period). This #'key strategy aims to increase users’ confidence in the reformed predictions. - #' #'@param data1 An 's2dv_cube' object with the element 'data' being a #' multidimensional array with named dimensions. All dimensions must be @@ -236,10 +235,11 @@ CST_MergeRefToExp <- function(data1, data2, start1 = NULL, end1 = NULL, #'(or other references) could be added at the end of the forecast lead time to #'cover the desired period (e.g.: until the end of summer). #' -#'This function is created to merge observations and forecasts in the -#'bioclimatic indicator structure, known as the ‘blending’ strategy (see -#'references). This key strategy aims to increase users’ confidence in the -#'reformed predictions. +#'This function is created to merge observations and forecasts, known as the +#'‘blending’ strategy (see references). The basis for this strategy is that the +#'predictions are progressively replaced with observational data as soon as they +#'become available (i.e., when entering the indicator definition period). This +#'key strategy aims to increase users’ confidence in the reformed predictions. #' #'@param data1 A multidimensional array with named dimensions. All dimensions #' must be equal to 'data2' dimensions except for the ones specified with diff --git a/man/MergeRefToExp.Rd b/man/MergeRefToExp.Rd index 047ad37..33b5d42 100644 --- a/man/MergeRefToExp.Rd +++ b/man/MergeRefToExp.Rd @@ -92,10 +92,11 @@ period because it is initialized too early (e.g.: Initialization on November cover the desired period (e.g.: until the end of summer). } \details{ -This function is created to merge observations and forecasts in the -bioclimatic indicator structure, known as the ‘blending’ strategy (see -references). This key strategy aims to increase users’ confidence in the -reformed predictions. +This function is created to merge observations and forecasts, known as the +‘blending’ strategy (see references). The basis for this strategy is that the +predictions are progressively replaced with observational data as soon as they +become available (i.e., when entering the indicator definition period). This +key strategy aims to increase users’ confidence in the reformed predictions. } \examples{ data_dates <- c(seq(as.Date("01-07-1993", "\%d-\%m-\%Y", tz = 'UTC'), -- GitLab