| reliability_data {weibulltools} | R Documentation |
Reliability Data
Description
Create consistent reliability data based on an existing data.frame
(preferred) or on multiple equal length vectors.
Usage
reliability_data(data = NULL, x, status, id = NULL, .keep_all = FALSE)
Arguments
data |
Either |
x |
Lifetime data, that means any characteristic influencing the reliability of a product, e.g. operating time (days/months in service), mileage (km, miles), load cycles. |
status |
Binary data (0 or 1) indicating whether a unit is a right censored observation (= 0) or a failure (= 1). |
id |
Identification of every unit. |
.keep_all |
If |
Value
A tibble with class wt_reliability_data containing the following
columns (if .keep_all = FALSE):
-
x: Lifetime characteristic. -
status: Binary data (0 or 1) indicating whether a unit is a right censored observation (= 0) or a failure (= 1). -
id: Identification for every unit.
If .keep_all = TRUE, the remaining columns of data are also preserved.
If !is.null(data) the attribute characteristic holds the name of the
characteristic described by x. Otherwise it is set to "x".
Examples
# Example 1 - Based on an existing data.frame/tibble and column names:
data <- reliability_data(
data = shock,
x = distance,
status = status
)
# Example 2 - Based on an existing data.frame/tibble and column positions:
data_2 <- reliability_data(
data = shock,
x = 1,
status = 3
)
# Example 3 - Keep all variables of the tibble/data.frame entered to argument data:
data_3 <- reliability_data(
data = shock,
x = distance,
status = status,
.keep_all = TRUE
)
# Example 4 - Based on vectors:
cycles <- alloy$cycles
state <- alloy$status
id <- "XXXXXX"
data_4 <- reliability_data(
x = cycles,
status = state,
id = id
)