Generate a random vector
stm_random_vector.Rd
stm_random_vector()
generates a random vector with values between
the specified minimum and maximum. Optionally, the vector can be sorted
in increasing or decreasing order.
Usage
stm_random_vector(
min = 10,
max = 99,
n = 10,
replace = TRUE,
set_seed = NULL,
is_sorted = FALSE,
is_decreasing = FALSE
)
Arguments
- min
The minimum value of the vector elements. Default is 10.
- max
The maximum value of the vector elements. Default is 99.
- n
The number of elements in the vector. Default is 10.
- replace
A logical indicating whether sampling is with replacement. Default is
TRUE
.- set_seed
Optional seed for random number generation.
- is_sorted
A logical indicating whether to sort the vector. Default is
FALSE
.- is_decreasing
A logical indicating whether to sort the vector in decreasing order. Default is
FALSE
.
Details
This function generates a random vector with the specified number of
elements and value range. The vector can be sorted in increasing or
decreasing order based on the is_sorted
and is_decreasing
parameters.