DndDice/man/combineDice.Rd
Joel Therrien 566b48ff62 Bug fixes for when die roll is non-integer
Also added a reroll function and simplified code greatly
2019-05-29 10:35:13 -07:00

29 lines
763 B
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/combineDice.R
\name{combineDice}
\alias{combineDice}
\title{Combine Dice}
\usage{
combineDice(x, y, fun)
}
\arguments{
\item{x}{A die}
\item{y}{A die}
\item{fun}{A function that takes two vectors containing the possible
combinations of die rolls of \code{x} and \code{y}; the output should be of
the same length. Example - \code{pmax} is such a function and is used to
take the maximum of two rolls.}
}
\value{
A new die with the possible possibilities and their corresponding
probabilties
}
\description{
This function is a way to combine two independent dice rolls into a new die.
}
\examples{
summed.die <- combineDice(d4, d6, `+`)
advantaged.die <- combineDice(d4, d4, pmax)
}