group_if function

Group vector values