mcs_mileage_data {weibulltools} | R Documentation |
MCS Mileage Data
Description
Create consistent mcs_mileage_data
based on an existing data.frame
(preferred)
or on multiple equal length vectors
Usage
mcs_mileage_data(
data = NULL,
mileage,
time,
status = NULL,
id = NULL,
.keep_all = FALSE
)
Arguments
data |
Either |
mileage |
Covered distances. Use |
time |
Operating times. Use |
status |
Optional argument. If used, it must contain binary data (0 or 1) indicating whether a unit is a right censored observation (= 0) or a failure (= 1). If |
id |
Identification of every unit. |
.keep_all |
If |
Value
A tibble
with class wt_mcs_mileage_data
that is formed for the downstream
Monte Carlo method mcs_mileage.
It contains the following columns (if .keep_all = FALSE
):
-
mileage
: Input mileages. -
time
: Input operating times. -
status
(optional) :If
is.null(status)
columnstatus
does not exist.If
status
is provided the column contains the entered binary data (0 or 1).
-
id
: Identification for every unit.
If .keep_all = TRUE
, the remaining columns of data
are also preserved.
The attribute mcs_characteristic
is set to "mileage"
.
See Also
dist_mileage for the determination of a parametric annual mileage distribution and mcs_mileage for the Monte Carlo method with respect to unknown distances.
Examples
# Example 1 - Based on an existing data.frame/tibble and column names:
mcs_tbl <- mcs_mileage_data(
data = field_data,
mileage = mileage,
time = dis,
status = status
)
# Example 2 - Based on an existing data.frame/tibble and column positions:
mcs_tbl_2 <- mcs_mileage_data(
data = field_data,
mileage = 3,
time = 2,
id = 1
)
# Example 3 - Keep all variables of the tibble/data.frame entered to argument data:
mcs_tbl_3 <- mcs_mileage_data(
data = field_data,
mileage = mileage,
time = dis,
status = status,
id = vin,
.keep_all = TRUE
)
# Example 4 - Based on vectors:
mcs_tbl_4 <- mcs_mileage_data(
mileage = field_data$mileage,
time = field_data$dis,
status = field_data$status,
id = field_data$vin
)