Create consistent reliability data based on an existing data.frame
(preferred) or on multiple equal length vectors.
reliability_data(data = NULL, x, status, id = NULL, .keep_all = FALSE)Either NULL or a data.frame. If data is NULL,
x, status and id must be vectors containing
the data. Otherwise x, status and id can be either column
names or column positions.
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.
Binary data (0 or 1) indicating whether a unit is a right censored observation (= 0) or a failure (= 1).
Identification of every unit.
If TRUE keep remaining variables in data.
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".
# 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
)