generate_random_number: Random Number Generator

Description Usage Arguments Examples

View source: R/generate_random_number.R

Description

generate_random_number draws a random number(s) from a range either as an integer or a float with a specified number of decimal digits

Usage

1
2
generate_random_number(n = NULL, min = NULL, max = NULL,
  type = "integer", digits = NULL)

Arguments

n

numeric; a numeric value that specifies the number of random numbers the user would like returned

min

numeric; a numeric value that specifies the minimum number in the range to draw from

max

numeric; a numeric value that specifies the maximum number in the range to draw from

type

string; a string that must be either "integer" or "float", specifies the format of the desired, numeric output as either an integer or float value

digits

optional numeric; a numeric value to accompany type = "float" and specify the number of decimal digits to include

Examples

1
2
3
4
5
6
7
generate_random_number(n = 1, min = 1, max = 10, type = "integer")

generate_random_number(n = 2, min = 1, max = 10, type = "float", digits = 3)

generate_random_number(
  n = 3, min = 1, max = 10, type = "float", digits = "5"
  )

mike-decarlo/caser documentation built on Sept. 23, 2019, 7:15 a.m.