getRandomData {ncldata}R Documentation

Get random subset of a dataset by providing a seed.

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

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

##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)

[Package ncldata version 1.2 Index]