knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of prediction.game is to provide a function for the interactive testing --- as a demonstration during class --- of competing answers to a statistical question.
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("davidkane9/prediction.game")
This is a basic example. The data is a vector of length 10. The contest is to pick a number which is closest to the result of a random sample (of size 1) from that data. One person guesses 3. Another person guesses 7. We run the context 5 times. In the example, each guess "won" twice and there was one tie.
library(prediction.game) set.seed(10) play(data = 1:10, n = 5, guess_1 = 3, guess_2 = 7, sample, size = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.