Hi ,

I am trying a simple example to assign entire rows to a
Rcpp::NumericMatrix. I read the Rcpp sugar document and looked at a few
online
examples. My simple code below produces errors:


 #include <iostream>
 #include <Rcpp.h>

using std::cout;
using  std:endl;

// [[Rcpp::export]

void test()
{

     Rcpp::NumericMatrux mat(100,100);
     int rows = mat.nrow();
     int cols  = mat.ncol();
     cout << "rows " << rows << endl;
     cout << "cols " << cols << endl;
      Rcpp::NumericVector row2 = mat(1,_);
     cout << "mat(1,_) " << row2 << endl;



}


Error:   error: '_' was not declared in this scope

Thank you
Bharath
_______________________________________________
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