- (df-sample df n [with-replacement: #f])procedure
Returns n rows chosen at random: independently with replacement (duplicates possible) when with-replacement is true, or without replacement otherwise (errors if n exceeds df's row count, since that many distinct rows don't exist).
All six of the above preserve grouping: applied to a grouped data frame, the result is regrouped by the same columns.