addStochList: Add stochasticity to a list

View source: R/13-01-defineFunctions.R

addStochListR Documentation

Add stochasticity to a list

Description

Add stochastic noise to a list variable.

Usage

addStochList(x, stoch)

Arguments

x

A list of numeric vectors.

stoch

A numeric vector of length 1.

Details

This function was created to multiply multiple elements of a list by a stochastic variable that was drawn from a random number generator. But, more generally it is just list multiplication with a different name.

Value

The element-wise product of x and stoch.

Examples


# x <- list(
#   runif(10, 1, 10),
#   runif(10, 10, 20)
# )
#
# addStochList(x, runif(1, 0, 1))

danStich/shadia documentation built on Nov. 2, 2023, 6:43 a.m.