Skip to content

Commit

Permalink
Don't error when grouping zero-row data frames. Fixes tidyverse#486
Browse files Browse the repository at this point in the history
  • Loading branch information
wch committed Jul 8, 2014
1 parent 424b304 commit a79ce47
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions inst/include/dplyr/Order.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ namespace dplyr {
} ;

inline Rcpp::IntegerVector OrderVisitors::apply() const {
if ( nrows == 0 ) return IntegerVector::create();
IntegerVector x = seq(0, nrows -1 ) ;
std::sort( x.begin(), x.end(), OrderVisitors_Compare(*this) ) ;
return x ;
Expand Down

0 comments on commit a79ce47

Please sign in to comment.