Created
January 13, 2023 15:06
-
-
Save BerriJ/45aa5e34ca273acd3d2e99bcaebabf19 to your computer and use it in GitHub Desktop.
Expose R function splines::splineDesign to Rcpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <RcppArmadillo.h> | |
// Expose splines::splineDesign to Rcpp | |
mat splineDesign_rcpp(const vec &x, const vec &knots, const int °) | |
{ | |
Rcpp::Environment pkg = Rcpp::Environment::namespace_env("splines"); | |
Rcpp::Function f = pkg["splineDesign"]; | |
mat y = Rcpp::as<arma::mat>(f(knots, x, deg + 1, 0, true)); | |
return y; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment