knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

Overview

"dieroller" is a minimal R package that provides functions to simulate rolling a die.

Motivation

This package has been developed to illustrate some of the concepts behind the creation of an R package.

Installation

Install the development version from GitHub via the package "devtools":

# development version from GitHub:
#install.packages("devtools")

# install "dieroller" (without vignettes)
devtools::install_github("gastonstat/dieroller")

# install "dieroller" (with vignettes)
devtools::install_github("gastonstat/dieroller", build_vignettes = TRUE)

Basic Usage

library(dieroller)

# default die
die1 <- die()
die1

# 1 roll of die1
roll(die1)

# 10 rolls of die1
rolls10 <- roll(die1, times = 10)
rolls10

# summary
summary(rolls10)

# 100 rolls
rolls100 <- roll(die1, times = 100)

# summary
summary(rolls100)


gastonstat/dieroller documentation built on April 12, 2020, 12:22 a.m.