Hi everyone,

I am trying to copy the rownames and the colnames from a NumericMatrix to another NumericMatrix by using Rcpp

Here is my code:

Rcpp::NumericMatrix copy(const Rcpp::NumericMatrix& m)
{
  Rcpp::NumericMatrix m2(num_genes, num_samples);
  Rcpp::rownames(m2) = Rcpp::rownames(m);
  Rcpp::colnames(m2) = Rcpp::colnames(m);

  return m2;
}

It does change the default rownames and colnames of the NumericMatrix.
Do you know how to do it?

Thanks in advance.
_______________________________________________
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