openxlsx
openxlsx copied to clipboard
type = 'blanks' option not available for conditionalFormatting()
I'm looking at the docs for the conditionalFormatting()
function (https://ycphs.github.io/openxlsx/reference/conditionalFormatting.html), and it states that type = "blanks"
and type = "noBlanks"
are valid options for the type
parameter. See the excerpt below:
**type**
Either 'expression', 'colourScale', 'databar', 'duplicates', 'beginsWith', 'endsWith', 'topN', 'bottomN', 'blanks', 'notBlanks', 'contains' or 'notContains' (case insensitive).
...
If type == "blanks":
- style is a Style object. See createStyle()
- rule is ignored.
If type == "notBlanks":
- style is a Style object. See createStyle()
- rule is ignored.
However, when I try to use the type = "blanks"
argument, I get the following error message:
Error in conditionalFormatting(wb, sheet = "Test Sheet", cols = ncol(test), : Invalid type argument. Type must be one of 'expression', 'colourScale', 'databar', 'duplicates', 'beginsWith', 'endsWith', 'contains' or 'notContains'
This contradicts the "type" options that are listed in the documentation.
Here is some example code to reproduce the error:
test <- data.frame(sample(c("X", NA_character_), 10, replace = TRUE),
sample(c("X", NA_character_), 10, replace = TRUE))
wb <- createWorkbook()
addWorksheet(wb, sheetName = "Test Sheet")
writeData(wb, sheet = "Test Sheet", x = test)
conditionalFormatting(wb, sheet = "Test Sheet", cols = ncol(test), rows = 1:nrow(test), type = "blanks", style = createStyle(bgFill = "#FFE090"))
Am I using the "type" parameter incorrectly, or do I have the wrong package version? Why does the blanks
type option not work? I'm using openxlsx v4.2.5
.
I downloaded the development version of the package from Github, and the issue was fixed. I can now use the "blanks" argument. Maybe it should be specified in the docs that this is not available in the CRAN 4.2.5 version?
Yeah sorry, because of this I wanted to bundle pending changes in the development branch, but forgot about it and it was nowhere mentioned outside my head. Guess it's not really a huge problem, more or less an inconvenience. If you have a good idea how to mention this, please feel free to open a pull request.
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.