The following code here highlights cells when the Count is more than 32, what I want is it to highlight the entire row
df = data.frame(Year = c(2018,2019,2020,2018,2019,2020,2018,2019,2020),
Country = c("Germany","Germany","Germany", "Japan", "Japan", "Japan", "Thailand", "Thailand", "Thailand"),
Count = c(17, 15, 60, 23, 25, 60, 50, 18, 31))
wb = createWorkbook()
addWorksheet(wb, "Master")
writeDataTable(wb, "Master", df, tableStyle = "TableStyleLight9")
yellow_style = createStyle(fgFill = "#FFFF00")
y = which(colnames(df) == "Count")
x = which(abs(df$Count) > 32)
addStyle(wb, sheet = "Master", style = yellow_style, rows = x+1, col = y)
saveWorkbook(wb, "Master.xlsx", overwrite = TRUE)
To highlight rows up to certain column use
1:n
index:To highlight the entire row, use some big number for columns:
There is an open feature request at GitHub #439