Appendix: R Quick Reference

This appendix lists every R package and function used in this book, organized by package, with the chapter(s) where each appears. Use it as a lookup reference when you want to find the right function quickly without having to search through the chapters.

Install all packages at once with:

install.packages(c(
  "ReliaLearnR",
  "WeibullR",
  "WeibullR.ALT",
  "ReliaGrowR",
  "DiagrammeR",
  "ReliaPlotR",
  "ReliaShiny"
))

ReliaLearnR

RAM (Reliability, Availability, and Maintainability) calculation helpers. All five functions accept scalar or vector inputs and return a single numeric scalar.

install.packages("ReliaLearnR")
library(ReliaLearnR)
Function Description Chapter
rel(outageTime, totalTime) Reliability: \(1 - \text{outage} / \text{total}\) Ch. 1
avail(unavailTime, totalTime) Availability: \(1 - \text{unavailable} / \text{total}\) (failures + maintenance) Ch. 1
mttf(failures, totalTime) Mean Time to Failure for non-repairable items Ch. 1
mtbf(failures, totalTime) Mean Time Between Failures for repairable systems Ch. 1
fr(failures, totalTime) Failure rate \(\lambda = \text{failures} / \text{total time}\) Ch. 1

Example usage:

library(ReliaLearnR)

rel(outageTime = 10, totalTime = 5 * 365)   # reliability over 5 years
[1] 0.9945205
avail(unavailTime = 25, totalTime = 5 * 365) # availability with maintenance
[1] 0.9863014
mttf(failures = 5, totalTime = 100 * 5)      # MTTF for a fleet of 100 units
[1] 100
mtbf(failures = 5, totalTime = 45000)        # MTBF for a repairable machine
[1] 9000
fr(failures = 75, totalTime = 100 * 5000)    # failure rate (failures per hour)
[1] 0.00015

WeibullR

Life data analysis: Weibull probability plotting, distribution fitting, and confidence bounds.

install.packages("WeibullR")
library(WeibullR)
Function Description Chapter
wblr(...) Create a Weibull object from time/event data Ch. 3, 7
wblr.fit(obj, ...) Fit a distribution (MLE or MRR) to a wblr object Ch. 3, 7
wblr.conf(obj, ...) Compute confidence bounds on a fitted wblr object Ch. 3, 7
MLEw2p(...) Fit a 2-parameter Weibull distribution via MLE directly Ch. 3
plot_contour(obj) Static likelihood ratio contour plot Ch. 3

Example usage:

library(WeibullR)

failures <- c(500, 1200, 900, 1500, 750)
da <- wblr(x = failures, s = c(2000, 2000))  # 2 suspensions
da <- wblr.fit(da, method.fit = "mle")
da <- wblr.conf(da, method.conf = "lrb")
plot(da)

WeibullR.ALT

Accelerated Life Testing (ALT): fit life-stress relationships such as Arrhenius, Power Law, and Eyring to multi-stress datasets.

install.packages("WeibullR.ALT")
library(WeibullR.ALT)
Function Description Chapter
NelsonData(name) Load built-in Nelson ALT example datasets Ch. 5, 7
alt.data(...) Prepare an ALT data object from raw time/event/stress data Ch. 5, 7
alt.make(...) Create an ALT model object (specify distribution and relationship) Ch. 5, 7
alt.parallel(obj) Constrain Weibull slopes to be equal across stress levels Ch. 5, 7
alt.fit(obj, ...) Fit the life-stress relationship to the ALT model Ch. 5, 7

Example usage:

library(WeibullR.ALT)

nd <- NelsonData("E2")
da <- alt.data(nd)
mo <- alt.make(da, distribution = "Weibull", relationship = "Arrhenius")
mo <- alt.parallel(mo)
mo <- alt.fit(mo)
plot(mo)

ReliaGrowR

Reliability growth testing and repairable systems analysis: Crow-AMSAA, Duane, Power Law Process, and Mean Cumulative Function.

install.packages("ReliaGrowR")
library(ReliaGrowR)
Function Description Chapter
rdt(...) Plan a Reliability Demonstration Test Ch. 4
rga(times, ...) Fit a Crow-AMSAA (NHPP Power Law) reliability growth model Ch. 4, 7
predict_rga(obj, ...) Forecast cumulative failures from a rga object Ch. 4
duane(times, ...) Fit a Duane reliability growth model Ch. 4, 7
nhpp(...) Fit a Power Law Process to repairable systems data Ch. 6, 7
mcf(...) Estimate the Mean Cumulative Function (Nelson-Aalen) Ch. 6, 7
exposure(...) Compute fleet exposure from multi-system event data Ch. 6, 7

Example usage:

library(ReliaGrowR)

# Reliability growth
times <- c(9.2, 25, 61.5, 260, 300, 710, 916, 1010, 1220)
rga_fit <- rga(times, T = 1500)
plot(rga_fit)

# Repairable systems
events <- data.frame(id = c(1,1,1,2,2), time = c(100,300,500,200,450))
mcf_fit <- mcf(events)
plot(mcf_fit)

DiagrammeR

Graph and diagram visualisation: render Graphviz DOT diagrams for reliability block diagrams and fault trees.

install.packages("DiagrammeR")
library(DiagrammeR)
Function Description Chapter
grViz(diagram) Render a Graphviz DOT string as an SVG diagram Ch. 2

Example usage:

library(DiagrammeR)

grViz("
  digraph series {
    rankdir = LR
    node [shape = rectangle]
    A -> B -> C
  }
")

ReliaPlotR

Interactive, plotly-based versions of every static plot produced by WeibullR, WeibullR.ALT, and ReliaGrowR. Drop-in replacements that return plotly objects embeddable in Quarto documents and Shiny apps.

install.packages("ReliaPlotR")
library(ReliaPlotR)
Function Description Chapter
plotly_wblr(obj) Interactive Weibull probability plot Ch. 7
plotly_contour(obj) Interactive likelihood ratio contour plot Ch. 7
plotly_duane(obj) Interactive Duane reliability growth plot Ch. 7
plotly_rga(obj) Interactive Crow-AMSAA plot Ch. 7
plotly_alt(obj) Interactive ALT probability plot Ch. 7
plotly_rel(obj) Interactive life-stress relationship plot Ch. 7
plotly_nhpp(obj) Interactive NHPP intensity (recurrence rate) plot Ch. 7
plotly_mcf(obj) Interactive Mean Cumulative Function plot Ch. 7
plotly_exposure(obj) Interactive fleet exposure plot Ch. 7

Example usage:

library(ReliaPlotR)
library(WeibullR)

da <- wblr(x = c(500, 1200, 900, 1500, 750))
da <- wblr.fit(da, method.fit = "mle")
da <- wblr.conf(da, method.conf = "lrb")
plotly_wblr(da)   # interactive version of plot(da)

ReliaShiny

A point-and-click Shiny web application that wraps all of the above analyses in a browser-based UI — no coding required. Modules cover RAM, Life Data Analysis, Reliability Growth, ALT, Repairable Systems, and RBD.

install.packages("ReliaShiny")
library(ReliaShiny)
Function Description Chapter
ReliaShiny() Launch the ReliaShiny web application in the default browser Ch. 8

Example usage:

library(ReliaShiny)
ReliaShiny()