❗ Please read this carefully before using the latest BETS version (0.4.4)
The package went through considerable changes.
# cran version
install.packages("BETS")
# dev version
devtools::install_github("nmecsys/BETS")library(BETS)- BETS package underwent major changes in response to R Journal's reccomendations:
- New function names (see table below)
- Database onnection credentials are now encrypted
- Sample data was included in
/data, to allow the user to run examples even when offline, or when our server is down.
| Old name | New name |
|---|---|
| BETS.search | BETSsearch |
| BETS.get | BETSget |
| BETS.chart | chart |
| BETS.save.sas | saveSas |
| BETS.save.stata | saveStata |
| BETS.save.spss | saveSpss |
| BETS.corrgram | corrgram |
| BETS.dashboard | dashboard |
| BETS.deflate | deflate |
| BETS.dummy | dummy |
| BETS.grnn.test | grnn.test |
| BETS.grnn.train | grnn.train |
| BETS.normalize | normalize |
| BETS.predict | predict |
| BETS.report | report |
| BETS.sidra.get | sidraGet |
| BETS.sidra.search | sidraSearch |
| BETS.std_resid | std_resid |
| BETS.t_test | t_test |
| BETS.ur_test | ur_test |
- Package
forecast's newest version (8.3) contains a bug inndiffs. An error arises when trying to run Augmented Dickey-Fuller (ADF) tests. Therefore, BETS'reportfunction does not work properly if the user opt for SARIMA analysis with ADF tests. A solution is to installforecast 8.2:
remove.packages("forecast")
install.packages("devtools")
devtools::install_version("forecast", version = "8.2", type = "source")import rpy2.robjects as ro
import pandas as pd
from rpy2.robjects.packages import importr
from rpy2.robjects import pandas2ri
from rpy2.robjects.conversion import localconverter
# Getting Industrial Production (2002 = 100) - Rio de Janeiro
bets = importr("BETS")
dados = bets.BETSget(code=11081, data_frame=True)
with localconverter(ro.default_converter + pandas2ri.converter):
pim_rj = ro.conversion.rpy2py(dados)
print(pim_rj)
