play: Play the prediction game.

Description Usage Arguments Value Examples

View source: R/play.R

Description

Play the prediction game.

Usage

1
play(n, guess_1, guess_2, formula)

Arguments

n

The number of times to play the game.

guess_1

A number.

guess_2

A number.

formula

A formula to apply to data. Must begin with ~ and may include references to data that are in the global workspace.

Value

A tibble with the results of the game.

Examples

1
2
3
4
5
6
z <- play(n = 5, guess_1 = 3, guess_2 = 7, ~ sample(x = 1:10, size = 1))
z

z <- play(n = 500, guess_1 = 20.09, guess_2 = 20.07, 
          ~ mean(sample(mtcars$mpg, size = 10, replace = FALSE)))
table(z$winner)

davidkane9/prediction.game documentation built on Nov. 4, 2019, 9:45 a.m.