BTW since you have `using namespace Rcpp;` you don't need `Rcpp::` in
front of every function from the Rcpp namespace
Hadley
On Fri, Dec 27, 2013 at 3:21 PM, Scott Monroe wrote:
> Thanks so much. Sorry for the silly error in the example. The following
> works, and has the basic functionality I
Thanks so much. Sorry for the silly error in the example. The following
works, and has the basic functionality I'm looking for.
#include
using namespace Rcpp ;
// [[Rcpp::depends(RcppArmadillo)]]
// [[Rcpp::export]]
List check_B(arma::mat B) {
int p = B.n_cols;
arma::mat BB = B*B;
arma::
No need to convert NumericMatrix to Armadillo matrix, Rcpp does that
automatically.
I also changed the name of your functions because they were the same.
#include
using namespace Rcpp ;
// [[Rcpp::depends(RcppArmadillo)]]
// [[Rcpp::export]]
List list_check(arma::mat B) {
int p = B.n_cols;
On 27 December 2013 at 12:36, Scott Monroe wrote:
| I am trying to figure out how to create a package where I have one function
| call another, which returns a list. Some example .cpp code is below. If I
| just compile the first function, everything is fine. When I add the second
| function, I
Arte you using the functions ayou attached them? They both have the same
name...
Gesendet über den BlackBerry® Service von E-Plus.
-Original Message-
From: Scott Monroe
Sender: rcpp-devel-bounces@lists.r-forge.r-project.orgDate: Fri, 27 Dec 2013
12:36:16
To:
rcpp-devel@lists.r-forge.
I am trying to figure out how to create a package where I have one function
call another, which returns a list. Some example .cpp code is below. If I
just compile the first function, everything is fine. When I add the second
function, I get errors. I'm sure I'm using the Rcpp::List syntax
incor