I just started using kableExtra
library to make my tables look better in the PDF output.
But when I use kable()
function in R Notebook file, it does not show the output. Instead I see a large white space where the output should be.
Here is a screenshot:
When I Knit
the file to PDF I can see the output.
Here is a screenshot:
Is there a way I can make the output appear both in the Notebook and PDF?
Here is my code:
---
title: "R Notebook"
output:
pdf_document: default
html_notebook: default
---
```{r message=FALSE, warning=FALSE}
library(knitr)
library(kableExtra)
library(dplyr)
#plot(cars)
```
```{r}
cars %>%
slice(1:10) %>%
select(speed, dist) %>%
kable(format = "latex", booktabs = T) %>%
column_spec(column = 1:2, width = "0.5in")
```
format = "html"
, I don't see thekable()
table that I expect. It looks differently to the way it looks in PDF. It looks very plain without the lines. Is that normal behaviour? – Kevel