Skip to content

Commit

Permalink
sa.decomposition -> sa_decomposition
Browse files Browse the repository at this point in the history
sa.preprocessing -> sa_preprocessing
  • Loading branch information
AQLT committed Sep 27, 2023
1 parent c8b8331 commit b7f1526
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 26 deletions.
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ export(remove_outlier)
export(remove_ramp)
export(result)
export(sa.decomposition)
export(sa.preprocessing)
export(sa_decomposition)
export(sa_preprocessing)
export(sadecomposition)
export(sarima_decompose)
export(sarima_estimate)
Expand Down
6 changes: 3 additions & 3 deletions R/decomposition.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
NULL


#' @rdname sa.decomposition
#' @rdname sa_decomposition
#' @export
sadecomposition<-function(y, sa, t, s, i, mul){
if (! is.logical(mul))stop("Invalid SA decomposition")
Expand Down Expand Up @@ -33,7 +33,7 @@ sadecomposition<-function(y, sa, t, s, i, mul){
return (structure(list(series=y, sa=sa, trend=t, seas=s, irr=i, multiplicative=mul), class=c("JD3_SADECOMPOSITION", "JD3")))
}

#' @rdname sa.decomposition
#' @rdname sa_decomposition
#' @export
print.JD3_SADECOMPOSITION<-function(x, n_last_obs = frequency(x$series), ...){
cat("Last values\n")
Expand All @@ -43,7 +43,7 @@ print.JD3_SADECOMPOSITION<-function(x, n_last_obs = frequency(x$series), ...){
)
)
}
#' @rdname sa.decomposition
#' @rdname sa_decomposition
#' @export
plot.JD3_SADECOMPOSITION <- function(x, first_date = NULL, last_date = NULL,
type_chart = c("sa-trend", "seas-irr"),
Expand Down
28 changes: 21 additions & 7 deletions R/generics.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#'
#' @export
diagnostics<-function(x, ...){
UseMethod("diagnostics")
UseMethod("diagnostics", x)
}


Expand All @@ -24,15 +24,15 @@ diagnostics.JD3<-function(x, ...){
#' @param x,... parameters.
#'
#' @export
sa.preprocessing<-function(x, ...){
UseMethod("sa.preprocessing")
sa_preprocessing<-function(x, ...){
UseMethod("sa_preprocessing", x)
}


#' Generic Function for Seasonal Adjustment Decomposition
#'
#' Generic function to format the seasonal adjustment decomposition components.
#' \code{sa.decomposition()} is a generic function defined in other packages.
#' \code{sa_decomposition()} is a generic function defined in other packages.
#'
#' @param y,sa,t,s,i,mul seasonal adjustment decomposition parameters.
#' @param x the object to print.
Expand All @@ -45,11 +45,25 @@ sa.preprocessing<-function(x, ...){
#' @param ... further arguments.
#'
#' @return \code{"JD3_SADECOMPOSITION"} object.
#' @name sa.decomposition
#' @name sa_decomposition
NULL

#' @export
#' @rdname sa.decomposition
#' @rdname sa_decomposition
sa_decomposition<-function(x, ...){
UseMethod("sa_decomposition", x)
}

#' Deprecated functions
#'
#' @description
#' Use [sa_decomposition()] instead of `sa.decomposition()`.
#'
#' @inheritParams sa_decomposition
#' @name deprecated-rjd3toolkit
#' @export
#' @export
sa.decomposition<-function(x, ...){
UseMethod("sa.decomposition")
.Deprecated("sa_decomposition")
UseMethod("sa_decomposition", x)
}
17 changes: 17 additions & 0 deletions man/deprecated-rjd3toolkit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/sa.decomposition.Rd → man/sa_decomposition.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/sa.preprocessing.Rd → man/sa_preprocessing.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions vignettes/calendar_correction_functions.R

This file was deleted.

0 comments on commit b7f1526

Please sign in to comment.