imported from dplyrRcpp