Formatting Vector outputs in Kable

Hi All,

With the upcoming release of dplyr 1.0.0, and improvements and pushing for folks to be using {vctrs} when creating new objects that are vector based, there is likely going to be a number of new object classes coming out.

The default behavior of kable appears to use as.matrix to handle the formatting of any non-numeric column. as.matrix() does not apply any formatting. this causes any custom vector classes to not appear correctly on printing.

A solution would be to handle the formatting before kable by using some mutate_all(format) or similar, but this solution is clunky and requires the users to know to do this before kable.

I have a PR open right now on knitr changing the behavior to apply formatting within kable. All current kable calls do not need changing, this is just extending the ability - https://github.com/yihui/knitr/pull/1827

I'm curious if this ability is valued by other users - I have an immediate use case for my {colortable} package.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.