Re: [Rcpp-devel] Getting names

2014-03-25 Thread David Edwards
t: 25. marts 2014 10:45 To: '[email protected]' Subject: [Rcpp-devel] Getting names Another novice question: the function // [[Rcpp::export]] IntegerVector maketable(IntegerVector x) { IntegerVector tab=table(x); return tab; } returns a named vector, and is

Re: [Rcpp-devel] Getting names

2014-03-25 Thread Søren Højsgaard
ehalf Of David Edwards Sent: 25. marts 2014 10:45 To: '[email protected]' Subject: [Rcpp-devel] Getting names Another novice question: the function // [[Rcpp::export]] IntegerVector maketable(IntegerVector x) { IntegerVector tab=table(x); return tab; } returns a

[Rcpp-devel] Getting names

2014-03-25 Thread David Edwards
Another novice question: the function // [[Rcpp::export]] IntegerVector maketable(IntegerVector x) { IntegerVector tab=table(x); return tab; } returns a named vector, and is about twice as fast as the R function 'table'. Is there a way to extract the names of the vector as a CharacterVector