|
|
An R package to work with the triangle distribution and logarithmic triangle distribution
| Linux & MacOS | Windows | Code Coverage | CRAN Downloads | CRAN |
|---|---|---|---|---|
See the package documentation here:
Install the R package:
# Stable CRAN version
install.packages(triangle)
# OR development version from GitHub
require(devtools)
devtools::install_github("bertcarnell/triangle")use the functions:
a = minimumb = maximumc = moderequire(triangle)
# triangle distribution
# rtriangle(n, a, b, c)
rtriangle(5, 1, 5, 2)
# ptriangle(x, a, b, c)
ptriangle(0:5, 0, 10, 5)
# qtriangle(p, a, b, c)
qtriangle(seq(0, 1, by = 0.2), 1, 10, 3)
# dtriangle(x, a, b, c)
dtriangle(0:4, 0, 10, 5)
# logarithmic triangle distribution
# rlriangle(n, a, b, c, logbase)
rltriangle(5, 1, 100, 10)
# pltriangle(x, a, b, c, logbase)
pltriangle(10^(0:3), 1, 1000, 10)
# qltriangle(p, a, b, c, logbase)
qltriangle(seq(0, 1, by = 0.2), 1, 100, 20)
# dltriangle(x, a, b, c)
dltriangle(0:5, 1, 10, 5)