On 9 June 2020 at 04:33, Kiros Lo wrote:
| Hi there,
|       I am trying to use RcppArmadillo to rewrite a weighted linear
| regression function. But when I try to use devtools::document() to compile

Wrong mailing list?  We don't mention devtools::document() so can't help.

You could try RcppArmadillo.package.skeleton() instead (but be aware of an
issue between R 4.0.0 and Rcpp which is fixed in Rcpp 1.0.4.12 which you can
install from the Rcpp drat).

| the code, an error has occurred:
| 
| 
----------------------------------------------------------------------------------------------------------------
| ** byte-compile and prepare package for lazy loading
| Error: object 'RcppArmadillo' is not exported by 'namespace:Rcpp'

You may have gotten carried away with roxygen2 which is another tool our
documentation hardly or not at all talks about.

Dirk

| Execution halted
| ERROR: lazy loading failed for package 'fast'
| 
----------------------------------------------------------------------------------------------------------------
| 
| 
| This is the head of my function
| 
----------------------------------------------------------------------------------------------------------------
| #include <RcppArmadillo.h>
| // [[Rcpp::depends(RcppArmadillo)]]
| 
| //' estimate the regression estimates based on given the number of
| repetitions
| //'
| //' @param x a Matrix
| //' @export
| // [[Rcpp::export]]
| Rcpp::List fastLmX_impl(const arma::mat& X) {
|   ... something like this
| }
| 
----------------------------------------------------------------------------------------------------------------
| 
| 
| And I have already include Rcpp and RcppArmadillo in my DESCRIPTION file :
| 
----------------------------------------------------------------------------------------------------------------
| LinkingTo:
|     Rcpp,
|     RcppArmadillo
| Imports:
|     Rcpp (>= 0.11.0)
| 
----------------------------------------------------------------------------------------------------------------
| 
| 
| Any help will be appreciated!
| 
| Yours faithfully,
| Wing Lo
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel@lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to