I am implementing a statistical method in R using Rcpp and as per the repeated advice given on SO I've put all of this into a package. For my implementation, I am using a stochastic volatility routine available in the stochvol
package. The linking is done as described in Writing R Extensions 5.4.3 Linking to native routines in other packages and looks as follows (plus stochvol
in the LinkingTo
field):
#include <RcppArmadillo.h>
#include <R.h>
#include <R_ext/Rdynload.h>
void sv_update(const Rcpp::NumericVector &data, double *curpara_in, double *h_in,
double &h0, double *mixprob, int *r,
const bool centered_baseline, const double C0, const double cT,
const double Bsigma, const double a0, const double b0,
const double bmu, const double Bmu, const double B011inv,
const double B022inv, const bool Gammaprior, const bool truncnormal,
const double MHcontrol, const int MHsteps, const int parameterization,
const bool dontupdatemu, const double priorlatent0) {
static void(*fun)(const Rcpp::NumericVector &, double *, double *, double &, double *, int *, const bool, const double,
const double, const double, const double, const double, const double, const double, const double, const double,
const bool, const bool, const double, const int, const int, const bool, const double) = NULL;
if (fun==NULL) {
fun = (void(*)(const Rcpp::NumericVector &, double *, double *, double &, double *, int *, const bool, const double,
const double, const double, const double, const double, const double, const double, const double, const double,
const bool, const bool, const double, const int, const int, const bool, const double)) R_GetCCallable("stochvol", "update");
}
return fun(data, curpara_in, h_in, h0, mixprob, r, centered_baseline, C0, cT,
Bsigma, a0, b0, bmu, Bmu, B011inv, B022inv, Gammaprior, truncnormal,
MHcontrol, MHsteps, parameterization, dontupdatemu, priorlatent0);
}
The function has plenty of arguments so it doesn't look very appealing, but it's been working as it's supposed to for a while now.
My problem is that usually everything works fine, so when developing my code I wrote unit tests which ran smoothly. However, when I now try to run things in a small simulation I get:
function 'update' not provided by package 'stochvol'
Information online is sparse, but the suggestion in this thread is to reinstall the package. I just updated R to 3.5.0, did not copy any packages but reinstalled everything from scratch, but the issue remains.
Any ideas on what I can do to fix this?