I am applying conditional formatting to an excel sheet using OPENXLSX package in R. My code is something like this :
posStyle <- createStyle(fontColour = "#006100", bgFill = "#C6EFCE")
conditionalFormatting(wb=wb1, sheet='sheet1', cols=1:10, rows=1:100, rule=" > 4", type = "expression",style = posStyle)
The problem I am facing is that in between columns 1 and 10, if any column is non-numeric then the conditional formatting is applied to all cells in that column. This ideally shouldn't happen because my rule states apply formatting wherever cell value is greater than 4. Am I missing something? If not, is there any solution for this? Thanks!