3

One of cells in my RMarkdown document

```{r echo=FALSE}
head(data,3) %>% knitr::kable(caption = "Pierwsze 3 wiersze ze zbioru danych Lista_1.csv", digits = 2, booktabs = T) 

gives weird result after knitting to pdf: enter image description here

Of course there shouldn't be "\begin{table}" ,"\caption{}" and "\end{table}" parts. I use knitr::kable often and it never worked this way. Does anyone know how to fix it?

Edit: I have also noticed that all section headers (like "##Section2") below the table are centered. They shouldn't.

Brzoskwinia
  • 371
  • 2
  • 11

1 Answers1

1

I've just found this question: How do I prevent kable from leaving raw latex in the final document if I include a caption in a table? and used tip from comment (format = pandoc). It worked for me.

Brzoskwinia
  • 371
  • 2
  • 11