Learn R Programming

OOmisc (version 1.2)

rtriangular: A function to generate random numbers from the triangular distribution.

Description

Generates a random sample of size n from the desired triangular distribution with parameters, a and b.

Usage

rtriangular(n, a, b)

Arguments

n
a numeric value which denotes the sample size.
a
a numeric value for the first parameter.
b
a numeric value for the second parameter.

Value

Returns a vector of sample.

Details

b should be greater than a.

References

Ilk, O. (2011). R Yazilimina Giris [Introduction to R Language]. ODTU Yayincilik [METU Press].

Examples

Run this code
rtriangular(5,1,5)

Run the code above in your browser using DataLab