Re: [Rcpp-devel] Principal Component in Armadillo

2013-03-12 Thread Dirk Eddelbuettel
On 12 March 2013 at 14:10, João Daniel Nunes Duarte wrote: | Thanks for your explanation, Dirk! Indeed, I looked at Armadillo documentation, | but it was not clear what was the kind of return. | | Regarding the linking error, I had created the package using | Rcpp.package.skeleton (because I did

Re: [Rcpp-devel] Principal Component in Armadillo

2013-03-12 Thread João Daniel Nunes Duarte
Thanks for your explanation, Dirk! Indeed, I looked at Armadillo documentation, but it was not clear what was the kind of return. Regarding the linking error, I had created the package using Rcpp.package.skeleton (because I didn't know I was going to use RcppArmadillo), and then I made the necessa

Re: [Rcpp-devel] Principal Component in Armadillo

2013-03-11 Thread Dirk Eddelbuettel
On 11 March 2013 at 22:42, João Daniel Nunes Duarte wrote: | Hello, | | I'm trying to calculate principal component using 'princomp' function from | RcppArmadillo. Here's the cpp code: | | #include | | RcppExport SEXP pca(SEXP mats) {  |   try { |     |     Rcpp::NumericMatrix matr(mats); |  

[Rcpp-devel] Principal Component in Armadillo

2013-03-11 Thread João Daniel Nunes Duarte
Hello, I'm trying to calculate principal component using 'princomp' function from RcppArmadillo. Here's the cpp code: #include RcppExport SEXP pca(SEXP mats) { try { Rcpp::NumericMatrix matr(mats); int n = matr.nrow(), k = matr.ncol(); arma::mat mat(matr.begin(), n, k, false);