I want to process an Excel Workbook (.xlsx or .xlsm) with multiple sheets using R. More specifically, I want to inspect the formatting (e.g. the background fill color) of each cell with data and do conditional processing based on that.
I have looked in several R packages for processing Excel files but couldn't figure out how to do this. The openxlsx package has the function getStyles which returns the list of all styles in the work book, but it is not useful for my purpose here since I want to read the style information of specific cells. The XLConnect package has similar functions which can find styles by name or data type, but the work book I want to process is prepared manually and doesn't have named styles as far as I know.
Is there a way to read style information of a single cell in an Excel Work book in R?
As pointed out by Stéphane Laurent in the comment above, tidyxl
package has functions to get all different styles used in a sheet, and to get cells to which each style is applied.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With