powered by
Subsets up to n elements in a vector
smart_subset(x, n)
A vector.
A number.
vector of length equal to length of x or n, whichever is smallest.
# NOT RUN { smart_subset(1:10, 5) smart_subset(1:10, 50) # }
Run the code above in your browser using DataLab