I have a dataset containing the service level agreement (SLA) scores of various suppliers and want to use r/rmarkdown to generate a report each month that highlights the suppliers doing well and those who are underperforming.
A reprex of the data is included below. How can I filter the data based on whether the supplier achieves the benchmark score? I would like it to return the supplier names, SLAs, and scores for those entries where the corresponding benchmark score has not been achieved. "Is the score for this supplier and this SLA higher than the corresponding benchmark SLA score?"
supplier_name <- c("benchmark", "benchmark", "benchmark", "supplier1", "supplier1", "supplier1", "supplier2", "supplier2", "supplier2", "supplier3", "supplier3", "supplier3")
sla <- c("sla1", "sla2", "sla3", "sla1", "sla2", "sla3", "sla1", "sla2", "sla3", "sla1", "sla2", "sla3")
score <- c("100", "95", "100", "100", "100", "99", "100", "98", "100", "80", "82", "95")
df <- tibble(supplier_name, sla, score)
Is my data in a suitable shape? or would it be more appropriate to have a vector containing the benchmark scores to use in some comparison?
Thanks.
