I would like to replicate the following table that in tableau is called Spotlighting
In my case I would like to replicate it with the following base that gives me color to the maximum value per row that are the questions I have an idea to do it with cell_spec()
from the kableExtra
package
library(knitr)
library(kableExtra)
Name<-c("question1", "question", "question3", "question4",
"question5", "question6", "question7", "question8",
"question9", "question10")
A<-c(0, 3 ,0 ,1, 0, 0, 0, 0, 2, 0)
B<-c(5, 0, 1, 0, 3, 0, 3, 1, 0, 1)
C<-c(3, 0, 2 ,2 ,0 ,1, 0 ,1 ,0 ,2)
D<-c(4, 1, 3 ,2 ,0 ,5, 0 ,1 ,3 ,2)
tab<-data.frame("Name"=Name,"A"=A,"B"=B,"C"=C,"D"=D)
tab%>%
kbl() %>%
kable_paper("striped",full_width = F)
Remember that I want to get a table with a similar format only that now I will only show the largest number in the table