ropensci / unconf17

Website for 2017 rOpenSci Unconf
http://unconf17.ropensci.org
64 stars 12 forks source link

writexl package with ability to add highlighting and change font colors #80

Closed kbroman closed 7 years ago

kbroman commented 7 years ago

Suppose you want to encode data in an Excel file by highlighting cells in different colors, or changing font colors; it'd be great to have an R package that could create such. Asking for a friend. ๐Ÿ˜‰

karawoo commented 7 years ago

Omg Karl ๐Ÿ˜‚

sarahsupp commented 7 years ago

OMG I was just asked if an R package could do this [seriously] for a business. An employee wants to automate creating daily reports, but be able to output the summary into their existing excel files with color coded cells and font that sit on the server. It must be done this way, because these excel files are what everyone else uses to base the day's decisions on. This is not a drill.

mschubert commented 7 years ago

I've seen a lot of hate on this topic, but I was always missing a constructive point of view on why this could be helpful.

Yes, obviously, encoding information in a non-machine-readable way is bad. I'm not denying that.

The point is, there will be people who will not access this information encoded in the file programmatically but rather look at it in a tool like Excel.

Why do we consider providing an additional visual access to numerical data (e.g. values as colour scale) to be a bad thing? As long as all the information is available numbers, there is no reason why it should be viewed as inferior to make them human-readable as well.

carlganz commented 7 years ago

Working in public health, I have been dragged down this rabbit-hole more times than I would like to admit. Always found that openxlsx was more than sufficient.

jennybc commented 7 years ago

There are several packages that do this already! Such as

karawoo commented 7 years ago

@mschubert Yes, if the highlighting was truly redundant to data that is present in the table I wouldn't have such a problem with it. But in data I've received, this has never once been the case. Highlighting was always used instead of putting the values somewhere in the table, and often there was no indication whatsoever of what the colors represented. That said, I'm definitely guilty of oversimplifying to "highlighting = BAD" when I really mean "using highlighting as data without including the data in the table = BAD".

jennybc commented 7 years ago

@mschubert The big distinction is formatting as data (EVIL ๐Ÿ‘ฟ) and conditional formatting that reinforces the data (fine ๐Ÿ™‚).

mschubert commented 7 years ago

@karawoo @jennybc Totally agree.

jennybc commented 7 years ago

I suppose the worst of all is manual conditional formatting: in that case the formatting and the data can contradict each other ๐Ÿ˜ฌ.

batpigandme commented 7 years ago

I'm not a big conditional formatter, myself, but you can do it with Huxtable

jennybc commented 7 years ago

I kind of like conditional formatting and the only reason I don't use it more often in R is because I perceive it to be a PITA to implement. I haven't yet delved into packages like Huxtable but I'm pretty keen on the idea.

batpigandme commented 7 years ago

@jennybc I'm not against them, just rarely use 'em (partially bc they can be hard to read). Huxtable has a bit of a a ways to go (currently you need to add the names of your columns as the first row of a data frameโ€ฆand then you're formatting by index, and it gets a bit crazy), but proliferation of table-rendering package makes me think it's definitely in-demand.

jennybc commented 7 years ago

Yeah there should a nice grammar for mapping certain columns in your table (or functions thereof) to format attributes of other columns. The interface does seem hard to get right, but super important.

kbroman commented 7 years ago

I'm going to close this, because it was really just a Friday afternoon joke, and it shouldn't be cluttering the proper topics.