Skip to content

Commit

Permalink
Merge pull request #27 from palatej/develop
Browse files Browse the repository at this point in the history
New libraries
  • Loading branch information
palatej authored Feb 9, 2024
2 parents 02bc8b6 + 62f6536 commit 365647a
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export(to_tscollection)
export(trigonometric_variables)
export(ts_adjust)
export(ts_interpolate)
export(tsdata_of)
export(tsmoniker)
export(ucarima_canonical)
export(ucarima_estimate)
Expand Down
23 changes: 23 additions & 0 deletions R/timeseries.R
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,26 @@ data_to_ts<-function(s, name){
jtscoll<-.jcall("jdplus/toolkit/base/r/timeseries/TsUtility", "Ljdplus/toolkit/base/api/timeseries/Ts;", "makeTsCollection", jmoniker, type)
return (jtscoll)
}

#' Title
#'
#' @param values Values of the time series
#' @param dates Dates of the values (could be any date inside the considered period)
#'
#' @return A ts object. The frequency will be identified automatically and missing values will be added in need be.
#' The identified frequency will be the lowest frequency that match the figures.
#' The provided data can contain missing values (NA)
#' @export
#'
#' @examples
#' # Annual series
#' s<-tsdata_of(c(1,2,3,4), c("1990-01-01", "1995-01-01", "1996-01-01", "2000-11-01"))
#' # Quarterly series
#' t<-tsdata_of(c(1,2,3,NA,4), c("1990-01-01", "1995-01-01", "1996-01-01", "2000-08-01", "2000-11-01"))
tsdata_of<-function(values, dates){
jtsdata<-.jcall("jdplus/toolkit/base/r/timeseries/TsDataCollector", "Ljdplus/toolkit/base/api/timeseries/TsData;",
"of", as.numeric(values), as.character(dates))

return (.jd2r_tsdata(jtsdata))

}
Binary file modified data/retail.rda
Binary file not shown.
Binary file modified inst/java/jdplus-sa-base-api-3.2.2-SNAPSHOT.jar
Binary file not shown.
Binary file modified inst/java/jdplus-sa-base-core-3.2.2-SNAPSHOT.jar
Binary file not shown.
Binary file modified inst/java/jdplus-sa-base-protobuf-3.2.2-SNAPSHOT.jar
Binary file not shown.
Binary file modified inst/java/jdplus-sa-base-r-3.2.2-SNAPSHOT.jar
Binary file not shown.
Binary file modified inst/java/jdplus-toolkit-base-api-3.2.2-SNAPSHOT.jar
Binary file not shown.
Binary file modified inst/java/jdplus-toolkit-base-core-3.2.2-SNAPSHOT.jar
Binary file not shown.
Binary file modified inst/java/jdplus-toolkit-base-protobuf-3.2.2-SNAPSHOT.jar
Binary file not shown.
Binary file modified inst/java/jdplus-toolkit-base-r-3.2.2-SNAPSHOT.jar
Binary file not shown.
27 changes: 27 additions & 0 deletions man/tsdata_of.Rd

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

0 comments on commit 365647a

Please sign in to comment.