| Type: | Package |
| Title: | Interactive Reliability Probability Plots |
| Version: | 0.5 |
| Description: | Build interactive Reliability Probability Plots with 'plotly' by Carson Sievert (2020) https://plotly.com/r/, an interactive web-based graphing library. |
| URL: | https://paulgovan.github.io/ReliaPlotR/, https://github.com/paulgovan/ReliaPlotR |
| BugReports: | https://github.com/paulgovan/ReliaPlotR/issues |
| License: | Apache License version 1.1 | Apache License version 2.0 [expanded from: Apache License] |
| Imports: | plotly, ReliaGrowR, WeibullR, WeibullR.ALT |
| Suggests: | knitr, rmarkdown, spelling, testthat (≥ 3.0.0) |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| Config/testthat/edition: | 3 |
| Language: | en-US |
| NeedsCompilation: | no |
| Packaged: | 2026-04-17 16:51:28 UTC; paulgovan |
| Author: | Paul Govan |
| Maintainer: | Paul Govan <paul.govan2@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-04-18 05:50:21 UTC |
ReliaPlotR: Interactive Reliability Probability Plots
Description
Build interactive Reliability Probability Plots with 'plotly' by Carson Sievert (2020) https://plotly.com/r/, an interactive web-based graphing library.
Author(s)
Maintainer: Paul Govan paul.govan2@gmail.com (ORCID) [copyright holder]
See Also
Useful links:
Report bugs at https://github.com/paulgovan/ReliaPlotR/issues
Interactive ALT Probability Plot.
Description
Creates an interactive probability plot for an 'alt' object, overlaying one Weibull or lognormal fit line per stress level on a shared probability paper. The 'alt' object must have been processed through [WeibullR.ALT::alt.parallel()] before passing to this function.
Usage
plotly_alt(
alt_obj,
showConf = TRUE,
showGrid = TRUE,
main = "ALT Probability Plot",
xlab = "Time to Failure",
ylab = "Probability",
gridCol = "lightgray",
signif = 3,
cols = NULL
)
Arguments
alt_obj |
An object of class ''alt'' created by the 'WeibullR.ALT' package and fitted with 'alt.parallel()'. |
showConf |
Show Fisher-matrix confidence bounds (TRUE) or not (FALSE). Default is TRUE. |
showGrid |
Show grid (TRUE) or hide grid (FALSE). Default is TRUE. |
main |
Main title. Default is "ALT Probability Plot". |
xlab |
X-axis label. Default is "Time to Failure". |
ylab |
Y-axis label. Default is "Probability". |
gridCol |
Color of the grid. Default is "lightgray". |
signif |
Significant digits for hover text. Default is 3. |
cols |
Optional character vector of colors, one per stress level. Recycled to match the number of stress levels. When NULL a 10-color default palette is used. |
Value
A 'plotly' object representing the interactive ALT probability plot.
Examples
library(WeibullR.ALT)
d1 <- alt.data(c(248, 456, 528, 731, 813, 537), stress = 300)
d2 <- alt.data(c(164, 176, 289), stress = 350)
d3 <- alt.data(c(88, 112, 152), stress = 400)
obj <- alt.fit(
alt.parallel(
alt.make(list(d1, d2, d3), dist = "weibull", alt.model = "arrhenius", view_dist_fits = FALSE),
view_parallel_fits = FALSE
)
)
plotly_alt(obj)
Interactive Contour Plot
Description
This function creates an interactive contour plot for one or more 'wblr' objects, each assumed to have confidence contours generated via ‘method.conf = ’lrb''. The function overlays all contours in a single plot and displays their respective MLE point estimates.
Usage
plotly_contour(
wblr_obj,
main = "Contour Plot",
xlab = "Eta",
ylab = "Beta",
showGrid = TRUE,
cols = NULL,
gridCol = "lightgray",
signif = 3
)
Arguments
wblr_obj |
A single 'wblr' object or a list of 'wblr' objects. Each object must have contours generated using ‘method.conf = ’lrb''. |
main |
Main title for the plot. |
xlab |
X-axis label (typically Eta or Sigmalog). |
ylab |
Y-axis label (typically Beta or Mulog). |
showGrid |
Logical; whether to show grid lines (default TRUE). |
cols |
Optional vector of colors for each contour/estimate pair. If not provided, colors are chosen from a default palette. |
gridCol |
Color of the grid lines (default 'lightgray'). |
signif |
Number of significant digits to display for estimates and contour coordinates. Defaults to 3. |
Value
A 'plotly' object representing the interactive contour plot.
Examples
library(WeibullR)
library(ReliaPlotR)
failures1 <- c(30, 49, 82, 90, 96)
failures2 <- c(20, 40, 60, 80, 100)
obj1 <- wblr.conf(wblr.fit(wblr(failures1), method.fit = "mle"), method.conf = "lrb")
obj2 <- wblr.conf(wblr.fit(wblr(failures2), method.fit = "mle"), method.conf = "lrb")
plotly_contour(list(obj1, obj2), main = "Overlayed Contours")
Interactive Duane Plot.
Description
This function creates an interactive Duane plot for a duane object. The plot includes options to customize the appearance, such as colors and grid visibility.
Usage
plotly_duane(
duane_obj,
showConf = TRUE,
showGrid = TRUE,
main = "Duane Plot",
xlab = "Cumulative Time",
ylab = "Cumulative MTBF",
pointCol = "black",
fitCol = "black",
confCol = "black",
gridCol = "lightgray",
signif = 3
)
Arguments
duane_obj |
An object of class 'duane'. This object is created using the 'duane' function from the ReliaGrowR package. |
showConf |
Show the confidence bounds (TRUE) or not (FALSE). Default is TRUE. |
showGrid |
Show grid (TRUE) or hide grid (FALSE). Default is TRUE. |
main |
Main title. Default is "Duane Plot". |
xlab |
X-axis label. Default is "Cumulative Time". |
ylab |
Y-axis label. Default is "Cumulative MTBF". |
pointCol |
Color of the point values. Default is "black". |
fitCol |
Color of the model fit. Default is "black". |
confCol |
Color of the confidence bounds. Default is "black". |
gridCol |
Color of the grid. Default is "lightgray". |
signif |
Significant digits of results. Default is 3. Must be a positive integer. |
Value
A 'plotly' object representing the interactive Duane plot.
Examples
library(ReliaGrowR)
times <- c(100, 200, 300, 400, 500)
failures <- c(1, 2, 1, 3, 2)
fit <- duane(times, failures)
plotly_duane(fit)
Interactive Exposure Plot.
Description
The function creates an interactive exposure plot for one or more 'exposure' objects. When a list of objects is provided the estimates are overlaid on the same plot, each rendered in a distinct color. The plot shows the cumulative event rate over time as a step function.
Usage
plotly_exposure(
exposure_obj,
showGrid = TRUE,
main = "Exposure Plot",
xlab = "Time",
ylab = "Event Rate",
fitCol = "black",
gridCol = "lightgray",
signif = 3,
cols = NULL
)
Arguments
exposure_obj |
An object of class 'exposure', or a list of such objects. Each object is created using the 'exposure()' function from the 'ReliaGrowR' package. |
showGrid |
Show grid (TRUE) or hide grid (FALSE). Default is TRUE. |
main |
Main title. Default is "Exposure Plot". |
xlab |
X-axis label. Default is "Time". |
ylab |
Y-axis label. Default is "Event Rate". |
fitCol |
Color of the event rate step function. Default is "black". Used only for a single exposure object; ignored when 'cols' is provided or multiple objects are supplied. |
gridCol |
Color of the grid. Default is "lightgray". |
signif |
Significant digits of results. Default is 3. Must be a positive integer. |
cols |
Optional character vector of colors, one per exposure object. When provided, each object's step function is drawn in the corresponding color. Recycled if shorter than the number of objects. |
Value
A 'plotly' object representing the interactive exposure plot.
Examples
## Not run:
library(ReliaGrowR)
ids <- c("A", "A", "A", "B", "B", "C", "C", "C", "C")
times <- c(50, 150, 350, 100, 300, 80, 200, 320, 450)
fit <- exposure(id = ids, time = times)
plotly_exposure(fit)
# Overlay two exposure objects
fit2 <- exposure(id = c("X", "X", "Y"), time = c(60, 220, 180))
plotly_exposure(list(fit, fit2), cols = c("steelblue", "tomato"))
## End(Not run)
Interactive Mean Cumulative Function Plot.
Description
The function creates an interactive Mean Cumulative Function (MCF) plot for one or more 'mcf' objects. When a list of objects is provided the models are overlaid on the same plot, each rendered in a distinct color. The MCF is rendered as a step function. Optional confidence bounds are shown as a shaded band around the estimate.
Usage
plotly_mcf(
mcf_obj,
showConf = TRUE,
showGrid = TRUE,
main = "Mean Cumulative Function Plot",
xlab = "Time",
ylab = "Mean Cumulative Function",
fitCol = "black",
confCol = "black",
gridCol = "lightgray",
signif = 3,
cols = NULL
)
Arguments
mcf_obj |
An object of class 'mcf', or a list of such objects. Each object is created using the 'mcf()' function from the 'ReliaGrowR' package. |
showConf |
Show the confidence bounds (TRUE) or not (FALSE). Default is TRUE. |
showGrid |
Show grid (TRUE) or hide grid (FALSE). Default is TRUE. |
main |
Main title. Default is "Mean Cumulative Function Plot". |
xlab |
X-axis label. Default is "Time". |
ylab |
Y-axis label. Default is "Mean Cumulative Function". |
fitCol |
Color of the MCF step function. Default is "black". Used only for a single mcf object; ignored when 'cols' is provided or multiple objects are supplied. |
confCol |
Color of the confidence bounds. Default is "black". Used only for a single mcf object; ignored when 'cols' is provided or multiple objects are supplied. |
gridCol |
Color of the grid. Default is "lightgray". |
signif |
Significant digits of results. Default is 3. Must be a positive integer. |
cols |
Optional character vector of colors, one per mcf object. When provided, each object's step function and confidence bounds are drawn in the corresponding color. Recycled if shorter than the number of objects. |
Value
A 'plotly' object representing the interactive MCF plot.
Examples
## Not run:
library(ReliaGrowR)
ids <- c("A", "A", "A", "B", "B", "C", "C", "C", "C")
times <- c(50, 150, 350, 100, 300, 80, 200, 320, 450)
fit <- mcf(id = ids, time = times)
plotly_mcf(fit)
# Overlay two MCF objects
fit2 <- mcf(id = c("X", "X", "Y"), time = c(60, 220, 180))
plotly_mcf(list(fit, fit2), cols = c("steelblue", "tomato"))
## End(Not run)
Interactive NHPP Plot.
Description
The function creates an interactive Non-Homogeneous Poisson Process (NHPP) plot for one or more 'nhpp' objects. When a list of objects is provided the models are overlaid on the same plot, each rendered in a distinct color. The plot includes cumulative events over time, the model fit, and optional confidence bounds. Vertical lines indicate change points if breakpoints are specified in the nhpp object.
Usage
plotly_nhpp(
nhpp_obj,
showConf = TRUE,
showGrid = TRUE,
main = "NHPP Plot",
xlab = "Cumulative Time",
ylab = "Cumulative Events",
pointCol = "black",
fitCol = "black",
confCol = "black",
gridCol = "lightgray",
breakCol = "black",
signif = 3,
cols = NULL
)
Arguments
nhpp_obj |
An object of class 'nhpp', or a list of such objects. Each object is created using the 'nhpp()' function from the 'ReliaGrowR' package. |
showConf |
Show the confidence bounds (TRUE) or not (FALSE). Default is TRUE. |
showGrid |
Show grid (TRUE) or hide grid (FALSE). Default is TRUE. |
main |
Main title. Default is "NHPP Plot". |
xlab |
X-axis label. Default is "Cumulative Time". |
ylab |
Y-axis label. Default is "Cumulative Events". |
pointCol |
Color of the point values. Default is "black". Used only for a single nhpp object; ignored when 'cols' is provided or multiple objects are supplied. |
fitCol |
Color of the model fit. Default is "black". Used only for a single nhpp object; ignored when 'cols' is provided or multiple objects are supplied. |
confCol |
Color of the confidence bounds. Default is "black". Used only for a single nhpp object; ignored when 'cols' is provided or multiple objects are supplied. |
gridCol |
Color of the grid. Default is "lightgray". |
breakCol |
Color of the breakpoints. Default is "black". Used only for a single nhpp object; ignored when 'cols' is provided or multiple objects are supplied. |
signif |
Significant digits of results. Default is 3. Must be a positive integer. |
cols |
Optional character vector of colors, one per nhpp object. When provided, each object's points, fit line, confidence bounds, and breakpoints are all drawn in the corresponding color. Recycled if shorter than the number of objects. |
Value
A 'plotly' object representing the interactive NHPP plot.
Examples
## Not run:
library(ReliaGrowR)
times <- c(100, 200, 300, 400, 500)
events <- c(1, 2, 1, 3, 2)
fit <- nhpp(time = times, event = events)
plotly_nhpp(fit)
# Piecewise model with a breakpoint
times2 <- c(100, 200, 300, 400, 500, 600, 700, 800, 900, 1000)
events2 <- c(1, 2, 1, 1, 1, 2, 3, 1, 2, 4)
fit2 <- nhpp(time = times2, event = events2, breaks = 500)
plotly_nhpp(fit2, breakCol = "red")
# Overlay two models
plotly_nhpp(list(fit, fit2))
## End(Not run)
Interactive ALT Life-Stress Relationship Plot.
Description
Creates an interactive life-stress relationship (Arrhenius or Power Law) plot for an 'alt' object. Displays the characteristic-life estimates per stress level, the fitted relationship line, optional percentile bands with shading, and an optional goal-condition marker. The 'alt' object must have been processed through [WeibullR.ALT::alt.fit()] before passing to this function.
Usage
plotly_rel(
alt_obj,
showPerc = TRUE,
showGoal = TRUE,
showGrid = TRUE,
main = "Life-Stress Relationship",
xlab = "Stress",
ylab = "Time to Failure",
fitCol = "red",
ptCol = "black",
percCol = "blue",
goalCol = "orange",
gridCol = "lightgray",
signif = 3,
percentiles = c(10, 90)
)
Arguments
alt_obj |
An object of class ''alt'' created by the 'WeibullR.ALT' package and fitted with 'alt.fit()'. |
showPerc |
Show percentile lines with shading (TRUE) or not (FALSE). Default is TRUE. |
showGoal |
Show the goal-condition marker when one is present in 'alt_obj' (TRUE) or not (FALSE). Default is TRUE. |
showGrid |
Show grid (TRUE) or hide grid (FALSE). Default is TRUE. |
main |
Main title. Default is "Life-Stress Relationship". |
xlab |
X-axis label. Default is "Stress". |
ylab |
Y-axis label. Default is "Time to Failure". |
fitCol |
Color of the fitted relationship line. Default is "red". |
ptCol |
Color of the characteristic-life scatter points. Default is "black". |
percCol |
Color of the percentile lines and fill. Default is "blue". |
goalCol |
Color of the goal-condition marker. Default is "orange". |
gridCol |
Color of the grid. Default is "lightgray". |
signif |
Significant digits for hover text. Default is 3. |
percentiles |
Numeric vector of percentiles to draw as reference lines with shading. Sorted internally; shading is filled between adjacent lines. Default is 'c(10, 90)'. |
Value
A 'plotly' object representing the interactive life-stress plot.
Examples
library(WeibullR.ALT)
d1 <- alt.data(c(248, 456, 528, 731, 813, 537), stress = 300)
d2 <- alt.data(c(164, 176, 289), stress = 350)
d3 <- alt.data(c(88, 112, 152), stress = 400)
obj <- alt.fit(
alt.parallel(
alt.make(list(d1, d2, d3), dist = "weibull", alt.model = "arrhenius", view_dist_fits = FALSE),
view_parallel_fits = FALSE
)
)
plotly_rel(obj)
Interactive Reliability Growth Plot.
Description
The function creates an interactive reliability growth plot for one or more 'rga' objects. When a list of objects is provided the models are overlaid on the same plot, each rendered in a distinct color. The plot includes cumulative failures over time, the model fit, and optional confidence bounds. Vertical lines indicate change points if breakpoints are specified in the rga object.
Usage
plotly_rga(
rga_obj,
showConf = TRUE,
showGrid = TRUE,
main = "Reliability Growth Plot",
xlab = "Cumulative Time",
ylab = "Cumulative Failures",
pointCol = "black",
fitCol = "black",
confCol = "black",
gridCol = "lightgray",
breakCol = "black",
signif = 3,
cols = NULL
)
Arguments
rga_obj |
An object of class 'rga', or a list of such objects. Each object is created using the 'rga()' function from the 'ReliaGrowR' package. |
showConf |
Show the confidence bounds (TRUE) or not (FALSE). Default is TRUE. |
showGrid |
Show grid (TRUE) or hide grid (FALSE). Default is TRUE. |
main |
Main title. Default is "Reliability Growth Plot". |
xlab |
X-axis label. Default is "Cumulative Time". |
ylab |
Y-axis label. Default is "Cumulative Failures". |
pointCol |
Color of the point values. Default is "black". Used only for a single rga object; ignored when 'cols' is provided or multiple objects are supplied. |
fitCol |
Color of the model fit. Default is "black". Used only for a single rga object; ignored when 'cols' is provided or multiple objects are supplied. |
confCol |
Color of the confidence bounds. Default is "black". Used only for a single rga object; ignored when 'cols' is provided or multiple objects are supplied. |
gridCol |
Color of the grid. Default is "lightgray". |
breakCol |
Color of the breakpoints. Default is "black". Used only for a single rga object; ignored when 'cols' is provided or multiple objects are supplied. |
signif |
Significant digits of results. Default is 3. Must be a positive integer. |
cols |
Optional character vector of colors, one per rga object. When provided, each object's points, fit line, confidence bounds, and breakpoints are all drawn in the corresponding color. Recycled if shorter than the number of objects. |
Value
A 'plotly' object representing the interactive reliability growth plot.
Examples
library(ReliaGrowR)
times <- c(100, 200, 300, 400, 500)
failures <- c(1, 2, 1, 3, 2)
rga <- rga(times, failures)
plotly_rga(rga)
times <- c(100, 200, 300, 400, 500, 600, 700, 800, 900, 1000)
failures <- c(1, 2, 1, 1, 1, 2, 3, 1, 2, 4)
breakpoints <- 400
rga2 <- rga(times, failures, model_type = "Piecewise NHPP", breaks = breakpoints)
plotly_rga(rga2, fitCol = "blue", confCol = "blue", breakCol = "red")
# Overlay two models
rga3 <- rga(c(50, 150, 250, 350, 450), c(2, 1, 3, 1, 2))
plotly_rga(list(rga, rga3))
Interactive Probability Plot.
Description
This function creates an interactive probability plot for one or more wblr objects. When a list of objects is provided the models are overlaid on the same plot, each rendered in a distinct color. All objects must use the same distribution family. It can include confidence bounds, suspension data (single object only), and a results table.
Usage
plotly_wblr(
wblr_obj,
susp = NULL,
showConf = TRUE,
showSusp = TRUE,
showGrid = TRUE,
main = "Probability Plot",
xlab = "Time to Failure",
ylab = "Probability",
probCol = "black",
fitCol = "black",
confCol = "black",
intCol = "black",
gridCol = "lightgray",
signif = 3,
cols = NULL
)
Arguments
wblr_obj |
A single object of class 'wblr', or a list of such objects. This is a required argument. Each object must use the same distribution (e.g. all Weibull or all lognormal). Suspension subplots are only shown when a single object is provided. |
susp |
An optional numeric vector of suspension data. Default is NULL. Ignored when multiple wblr objects are provided. |
showConf |
Show the confidence bounds (TRUE) or not (FALSE). Default is TRUE if confidence bounds are available in the wblr object. |
showSusp |
Show the suspensions plot (TRUE) or not (FALSE). Default is TRUE if susp is provided. |
showGrid |
Show grid (TRUE) or hide grid (FALSE). Default is TRUE. |
main |
Main title. Default is 'Probability Plot'. |
xlab |
X-axis label. Default is 'Time to Failure'. |
ylab |
Y-axis label. Default is 'Probability'. |
probCol |
Color of the probability values. Default is 'black'. Used only for a single wblr object; ignored when 'cols' is provided or multiple objects are supplied. |
fitCol |
Color of the model fit. Default is 'black'. Used only for a single wblr object; ignored when 'cols' is provided or multiple objects are supplied. |
confCol |
Color of the confidence bounds. Default is 'black'. Used only for a single wblr object; ignored when 'cols' is provided or multiple objects are supplied. |
intCol |
Color of the intervals for interval censored models. Default is 'black'. |
gridCol |
Color of the grid. Default is 'lightgray'. |
signif |
Significant digits of results. Default is 3. Must be a positive integer. |
cols |
Optional character vector of colors, one per wblr object. When provided, each object's data points, fit line, and confidence bounds are all drawn in the corresponding color. Recycled if shorter than the number of objects. |
Value
A 'plotly' object representing the interactive probability plot.
Examples
library(WeibullR)
library(ReliaPlotR)
failures <- c(30, 49, 82, 90, 96)
obj <- wblr.conf(wblr.fit(wblr(failures)))
plotly_wblr(obj)
suspensions <- c(100, 45, 10)
obj <- wblr.conf(wblr.fit(wblr(failures, suspensions)))
plotly_wblr(obj, suspensions,
fitCol = "blue",
confCol = "blue"
)
inspection_data <- data.frame(
left = c(0, 6.12, 19.92, 29.64, 35.4, 39.72, 45.32, 52.32),
right = c(6.12, 19.92, 29.64, 35.4, 39.72, 45.32, 52.32, 63.48),
qty = c(5, 16, 12, 18, 18, 2, 6, 17)
)
suspensions <- data.frame(time = 63.48, event = 0, qty = 73)
obj <- wblr(suspensions, interval = inspection_data)
obj <- wblr.fit(obj, method.fit = "mle")
obj <- wblr.conf(obj, method.conf = "fm", lty = 2)
suspensions <- as.vector(suspensions$time)
plotly_wblr(obj,
susp = suspensions, fitCol = "red", confCol = "red", intCol = "blue",
main = "Parts Cracking Inspection Interval Analysis",
ylab = "Cumulative % Cracked", xlab = "Inspection Time"
)
failures <- c(25, 30, 42, 49, 55, 67, 73, 82, 90, 96, 101, 110, 120, 132, 145)
fit <- wblr.conf(wblr.fit(wblr(failures), dist = "weibull3p"))
plotly_wblr(fit, fitCol = "darkgreen", confCol = "darkgreen")
# Overlay two Weibull models
obj2 <- wblr.conf(wblr.fit(wblr(c(20, 40, 60, 80, 100)), method.fit = "mle"),
method.conf = "lrb")
obj3 <- wblr.conf(wblr.fit(wblr(c(10, 30, 50, 70, 90)), method.fit = "mle"),
method.conf = "lrb")
plotly_wblr(list(obj2, obj3))