Learn R Programming

dyngen (version 1.0.5)

rnorm_bounded: A bounded version of rnorm

Description

A bounded version of rnorm

Usage

rnorm_bounded(n, mean = 0, sd = 1, min = -Inf, max = Inf)

Value

Generates values with rnorm, bounded by [min, max]

Arguments

n

number of observations. If length(n) > 1, the length is taken to be the number required.

mean

vector of means.

sd

vector of standard deviations.

min

lower limits of the distribution.

max

upper limits of the distribution.

Examples

Run this code
rnorm_bounded(10)

Run the code above in your browser using DataLab