mlsjunkgend: Generate a data frame of pseudo-random numbers using the MLS...

Description Usage Arguments Value Examples

View source: R/mlsjunkgend.R

Description

Based on user input seeds, this function generates a data frame of n pseudo-random numbers and names the column containing these as "RN" for "random numbers." This is achieved by calling junkgen.

Usage

1
mlsjunkgend(n = 1, w, x, y, z, round = 5)

Arguments

n

the number of pseudo-random numbers to generate; defaults to 1

w

the first seed required by the MLS Junk Generator algorithm

x

the first seed required by the MLS Junk Generator algorithm

y

the first seed required by the MLS Junk Generator algorithm

z

the first seed required by the MLS Junk Generator algorithm

round

the number of decimal places to which to round the pseudo-random numbers; default = 5

Value

A numeric vector containing a single pseudo-random number

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Generate a pseudo-random number data frame with 10 observations from user-specified seeds

w <- 1
x <- 2
y <- 3
z <- 4

mlsjunkgend(n = 10, w = w, x = x, y = y, z = z) # returns a data frame of 10 observations

# Specifying different values for n and round

mlsjunkgend(n = 5, w = w, x = x, y = y, z = z, round = 2)
# returns a data frame identical to the above example but with only 5 observations
# rounded to 2 decimal places

# using the default value of n (1) is identical to assigning the rounded result of
# junkgen to a data frame of 1 observation

round(junkgen(w = w, x = x, y = y, z = z), 5) # returns "[1] 0.95516"
mlsjunkgend(w = w, x = x, y = y, z = z)
# returns the following:
#        RN
# 1 0.95516

mlsjunkgen documentation built on May 2, 2021, 1:06 a.m.