Type: | Package |
Title: | Interactive Weibull Probability Plots |
Version: | 0.3.2 |
Description: | Build interactive Weibull Probability Plots with 'WeibullR' by David Silkworth and Jurgen Symynck (2022) https://CRAN.R-project.org/package=WeibullR, an R package for Weibull analysis, and 'plotly' by Carson Sievert (2020) https://plotly-r.com, an interactive web-based graphing library. |
URL: | https://paulgovan.github.io/WeibullR.plotly/, https://github.com/paulgovan/WeibullR.plotly |
BugReports: | https://github.com/paulgovan/WeibullR.plotly/issues |
License: | Apache License version 1.1 | Apache License version 2.0 [expanded from: Apache License] |
Imports: | plotly, ReliaGrowR, WeibullR |
Suggests: | knitr, rmarkdown, spelling, testthat (≥ 3.0.0), WeibullR.learnr, WeibullR.shiny |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.3 |
Config/testthat/edition: | 3 |
Language: | en-US |
NeedsCompilation: | no |
Packaged: | 2025-09-24 02:28:37 UTC; paulgovan |
Author: | Paul Govan |
Maintainer: | Paul Govan <paul.govan2@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-09-24 05:11:18 UTC |
WeibullR.plotly: Interactive Weibull Probability Plots
Description
Build interactive Weibull Probability Plots with 'WeibullR' by David Silkworth and Jurgen Symynck (2022) https://CRAN.R-project.org/package=WeibullR, an R package for Weibull analysis, and 'plotly' by Carson Sievert (2020) https://plotly-r.com, 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/WeibullR.plotly/issues
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(WeibullR.plotly)
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,
showGrid = TRUE,
main = "Duane Plot",
xlab = "Cumulative Time",
ylab = "Cumulative MTBF",
pointCol = "black",
fitCol = "black",
gridCol = "lightgray"
)
Arguments
duane_obj |
An object of class 'duane'. This object is created using the 'duane' function from the ReliaGrowR package. |
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". |
gridCol |
Color of the grid. Default is "lightgray". |
Value
The function returns no value. It generates an 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 Reliability Growth Plot.
Description
The function creates an interactive reliability growth plot for an 'rga' object. 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"
)
Arguments
rga_obj |
An object of class 'rga'. This object is created using the 'rga()' function from the 'ReliaGrowR' package. |
showConf |
Show the confidence bounds (TRUE) or not (FALSE). |
showGrid |
Show grid (TRUE) or hide grid (FALSE). |
main |
Main title. |
xlab |
X-axis label. |
ylab |
Y-axis label. |
pointCol |
Color of the point values. |
fitCol |
Color of the model fit. |
confCol |
Color of the confidence bounds. |
gridCol |
Color of the grid. |
breakCol |
Color of the breakpoints. |
Value
The function returns no value. It generates an interactive plotly 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")
Interactive Probability Plot.
Description
This function creates an interactive probability plot for a wblr object. It can include confidence bounds, suspension data, and a results table.
Usage
plotly_wblr(
wblr_obj,
susp = NULL,
showConf = TRUE,
showSusp = TRUE,
showRes = TRUE,
showGrid = TRUE,
main = "Probability Plot",
xlab = "Time to Failure",
ylab = "Probability",
probCol = "black",
fitCol = "black",
confCol = "black",
intCol = "black",
gridCol = "lightgray",
signif = 3
)
Arguments
wblr_obj |
An object of class 'wblr'. This is a required argument. |
susp |
An optional numeric vector of suspension data. Default is NULL. |
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. |
showRes |
Show the results table (TRUE) or not (FALSE). Default is TRUE. |
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'. |
fitCol |
Color of the model fit. Default is 'black'. |
confCol |
Color of the confidence bounds. Default is 'black'. |
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. |
Value
The function returns no value. It creates an interactive probability plot.
Examples
library(WeibullR)
library(WeibullR.plotly)
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')