From 5c9a045b9e4226633fdcc89ba76275591d9ae6fe Mon Sep 17 00:00:00 2001 From: Jennifer Thom Date: Thu, 7 Nov 2024 16:06:13 +0000 Subject: [PATCH] Add conditional formatting --- functions/produce_tests.R | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/functions/produce_tests.R b/functions/produce_tests.R index 28cb9e9..a3ec499 100644 --- a/functions/produce_tests.R +++ b/functions/produce_tests.R @@ -99,6 +99,26 @@ write_tests_xlsx <- function(comparison_data, widths = 15L ) + # Apply conditional formatting to highlight issues + openxlsx::conditionalFormatting( + wb = wb, + sheet = sheet_name_dated, + cols = issue_col, + rows = 2L:(nrow(comparison_data) + 1L), + rule = "GREATER", + type = "contains" + ) + + # Apply conditional formatting to highlight issues + openxlsx::conditionalFormatting( + wb = wb, + sheet = sheet_name_dated, + cols = issue_col, + rows = 2L:(nrow(comparison_data) + 1L), + rule = "LOWER", + type = "contains" + ) + # Write workbook to disk -----------------------------------------------------