smart_subset function

Subsets up to n elements in a vector