# 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
)
Run the code above in your browser using DataLab