getRandomData: Get random subset of a dataset by providing a seed.

Description Usage Arguments Value Examples

View source: R/getRandomData.R

Description

This function creates a subset (of random rows) of a data set (by default, the IMDB movie data frame). Given a student id, this function will always return the same subset.

Usage

1
getRandomData(seed, d = movies)

Arguments

seed,

e.g "b1234567" or 18

d,

optional (default: movies), dataset to get a random subset from.

Value

A data frame with a random numer of rows

Examples

1
2
3
4
5
6
7
8
##Given the same student ID
##the same data set is returned
d1 = getRandomData("b1234567")
d2 = getRandomData("b1234567")
identical(d1, d2)
##Different IDs get different data
d3 = getRandomData("b1234568")
identical(d1, d3)

ncldata documentation built on May 2, 2019, 5:54 p.m.