Description Usage Arguments Examples
Sometimes you want a small sample of a data frame — as with head() — but you want as many different levels of the variables as possible to be included. This function takes a sample from a dataframe, arranging things so that as many distinct levels as possible of each value for each variable are kept. The incoming random seed will be restored when the function exits.
1 | representativeCases(.df, n = 5L, seed = 15)
|
.df |
data frame from which to select rows |
n |
number of rows to return |
seed |
a random seed to use for the random parts of the algorithm. If you want another result, change the seed. |
1 | representativeCases(BabyNames, n=6)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.