This post discusses a routine for sampling with different percentages by group.
But what about if you just want to sample, say, 50% without replacement by group? What about if you want to sample 50% with replacement by group?
With dplyr, you have sample_frac
to perform this. What about data.table?