representativeCases: Select n widely representative random cases

Description Usage Arguments Examples

Description

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.

Usage

1
representativeCases(.df, n = 5L, seed = 15)

Arguments

.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.

Examples

1

DataComputing/DataComputing documentation built on May 6, 2019, 1:39 p.m.