On 5 June 2013 at 16:32, Romain Francois wrote:
| This is now fixed in rev 4330.

Make it rev 4332 which now does the right thing:

R> sourceCpp("/tmp/toni.cpp")

R> truncateTest()
  STL Rcpp
1   1    1
2   2    2
3   3    3
4   4    4
5   5    5
R> 

Dirk

PS Once-more modified 'tony.cpp' below

#include <Rcpp.h>

// [[Rcpp::export]]
Rcpp::DataFrame truncateTest() {

  Rcpp::NumericVector l;
  std::vector<int> v;

  for (int i=1; i<=10; i++) {
    v.push_back(i);
    l.push_back(i);
  }

  v.erase(v.begin()+5,v.end());
  l.erase(l.begin()+5,l.end());

  return(Rcpp::DataFrame::create(Rcpp::Named("STL")=v, 
                                 Rcpp::Named("Rcpp")=l));
}

/*** R
truncateTest()
*/


-- 
Dirk Eddelbuettel | [email protected] | http://dirk.eddelbuettel.com
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to