I am producing an R-markdown report where plots and data tables are knitted into a pdf.
These data tables (package DT) have fantastic formatting options like styleColorBar, which I can see from the Viewer, in an HTML when I print in that format, but not in pdf, as far as I tried. Here is a sample of my code, where the second column, dist, should have intensity-bars in the cell background.
---
title: "prove27_2"
author: "Roberto Di Pietro"
date: "27/2/2020"
output: pdf_document
---
knitr::opts_chunk$set(echo = TRUE)
library(DT)
colors<-viridis::viridis(3,alpha=.3)[1]
datatable(cars) %>% formatStyle(names(cars)[2],
background = styleColorBar(range(cars[,2]),
colors
),
backgroundSize = '98% 88%',
backgroundRepeat = 'no-repeat',
backgroundPosition = 'center')
Is it something possible? Does it have to do with js or css or simply with an option that I am missing to find?