#' Roll a number of 6 sided die
#'
#' @param n Number of dice to roll.
#' @return A numeric vector of roll results.
#' @examples
#' roll_dice(3)
#' @export
roll_dice <- function(n = NULL) {
if (is.null(n)) {
double()
} else{
sample(
x = seq(1, 6),
size = n,
replace = TRUE
)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.