How can I create a formatted table for a PDF report using the kable
function in Rmarkdown? Here is a MWE:
library(knitr)
df <- data.frame(bucket = 1:11,
value = c(-0.8125594, -0.7590050, -0.7189301, -0.7188391, -0.5047816,
-0.3439579, -0.4376782, -0.1300217, 0.9145718, 2.1844290,
4.8374356))
print(kable(df))
Output:
| bucket| value|
|------:|----------:|
| 1| -0.8125594|
| 2| -0.7590050|
| 3| -0.7189301|
| 4| -0.7188391|
| 5| -0.5047816|
| 6| -0.3439579|
| 7| -0.4376782|
| 8| -0.1300217|
| 9| 0.9145718|
| 10| 2.1844290|
| 11| 4.8374356|
I am trying to format it for a PDF with a good visual like the picture attached: