R/currency.R

Defines functions ch_currency

Documented in ch_currency

#' Create fake currencies
#'
#' @export
#' @template params
#' @seealso [CurrencyProvider]
#' @examples
#' ch_currency()
#' ch_currency(10)
#' ch_currency(500)
ch_currency <- function(n = 1) {
  assert(n, c("integer", "numeric"))
  if (n == 1) {
    CurrencyProvider$new()$render()
  } else {
    x <- CurrencyProvider$new()
    replicate(n, x$render())
  }
}

Try the charlatan package in your browser

Any scripts or data that you put into this service are public.

charlatan documentation built on Sept. 13, 2023, 5:08 p.m.