CommencerCommencer gratuitement

Cost versus urgency

The dataset vacancies_impact we just created contains the total_cost and cost_impact for each case, but it also contains a data attribute urgency, which indicates whether the vacancy is urgent (urgency == 10) or not (urgency == 1). Use dplyr's case_when() to create the variable cost_profile, which indicates whether costs where incurred appropriately:

  • Disproportionate if cost_impact == High and urgency less than 7
  • Excessive if cost_impact == Medium, and urgency less than 5
  • Lacking if cost_impact == Low and urgency is greater than 6
  • Appropriate otherwise

Cet exercice fait partie du cours

Business Process Analytics in R

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Create cost_profile
vacancies_profile <- vacancies_impact %>%
  mutate(
    cost_profile = case_when(
      cost_impact == "High" & urgency < 7 ~ "Disproportionate",
      ___
      ___
      TRUE ~ "Appropriate"
    )
  )
Modifier et exécuter le code