Kosten versus Dringlichkeit
Der Datensatz vacancies_impact, den wir gerade erstellt haben, enthält total_cost und cost_impact für jeden Fall. Außerdem gibt es das Datenattribut urgency, das angibt, ob eine Vakanz dringend ist (urgency == 10) oder nicht (urgency == 1). Verwende dplyrs case_when(), um die Variable cost_profile zu erstellen, die angibt, ob Kosten angemessen angefallen sind:
- Disproportionate, wenn cost_impact == High und urgency kleiner als 7 ist
- Excessive, wenn cost_impact == Medium und urgency kleiner als 5 ist
- Lacking, wenn cost_impact == Low und urgency größer als 6 ist
- Appropriate sonst
Diese Übung ist Teil des Kurses
<Kurs>Business Process Analytics in R</Kurs>Interaktive praktische Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# Create cost_profile
vacancies_profile <- vacancies_impact %>%
mutate(
cost_profile = case_when(
cost_impact == "High" & urgency < 7 ~ "Disproportionate",
___
___
TRUE ~ "Appropriate"
)
)