Sample a proportion of indices of a vector
p_indices(x, p)
x
A vector
p
A numeric probability between 0 and 1
An integer vector of indices.