Skip to content

Commit

Permalink
Variables
Browse files Browse the repository at this point in the history
  • Loading branch information
palatej committed Mar 7, 2024
1 parent 44ebb8e commit f1fe64b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export(.enum_sextract)
export(.enum_sof)
export(.jd2p_calendars)
export(.jd2p_context)
export(.jd2p_variables)
export(.jd2r_calendars)
export(.jd2r_lts)
export(.jd2r_matrix)
Expand All @@ -75,11 +76,13 @@ export(.jd2r_ts)
export(.jd2r_tscollection)
export(.jd2r_tsdata)
export(.jd2r_ucarima)
export(.jd2r_variables)
export(.jd3_object)
export(.jdomain)
export(.p2jd_calendar)
export(.p2jd_calendars)
export(.p2jd_context)
export(.p2jd_variables)
export(.p2r_arima)
export(.p2r_calendars)
export(.p2r_context)
Expand Down Expand Up @@ -139,6 +142,7 @@ export(.r2jd_ts)
export(.r2jd_tscollection)
export(.r2jd_tsdata)
export(.r2jd_tsdomain)
export(.r2jd_variables)
export(.r2p_calendar)
export(.r2p_calendars)
export(.r2p_context)
Expand Down
35 changes: 35 additions & 0 deletions R/modellingcontext.R
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,41 @@ dynamic_ts<-function(moniker, data){
return (l)
}

#' @export
#' @rdname jd3_utilities
.p2jd_variables<-function(p){
bytes<-p$serialize(NULL)
jcal <- .jcall("jdplus/toolkit/base/r/util/Modelling", "Ljdplus/toolkit/base/api/timeseries/regression/TsDataSuppliers;",
"variablesOf",
bytes)
return (jcal)
}

#' @export
#' @rdname jd3_utilities
.jd2p_variables<-function(jd){
bytes<-.jcall("jdplus/toolkit/base/r/util/Modelling", "[B", "toBuffer", jd)
p<-RProtoBuf::read(jd3.TsDataSuppliers, bytes)
return (p)
}



#' @export
#' @rdname jd3_utilities
.jd2r_variables<-function(jcals){
p<-.jd2p_variables(jcals)
return (.p2r_datasuppliers(p))
}

#' @export
#' @rdname jd3_utilities
.r2jd_variables<-function(r){
p<-.r2p_datasuppliers(r)
return (.p2jd_variables(p))
}


#' Create context
#' @description
#' Function allowing to include calendars and external regressors in a format that makes them usable
Expand Down
12 changes: 12 additions & 0 deletions man/jd3_utilities.Rd

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

0 comments on commit f1fe64b

Please sign in to comment.