Marc BF
Marc BF

Reputation: 119

Rmarkdown output shows a table printed both in kable style and regular style

My code is the following:

kable(knit_print(func), format = "html", col.names = c("Point Name", "CFU count"))%>%
kable_styling(bootstrap_options = c("striped", "hover"))

Whenever I knit the Rmd document it displays a beautifully arranged version of the table I'm printing (func) and the 'regular' printing version (## # A tibble: 5 x 2, and displays table below).

How should I do it to only print the 'beautiful' version? I started using Rmarkdown a day ago and I'm still a bit lost about formatting, thanks a lot.

Upvotes: 0

Views: 1226

Answers (2)

Marc BF
Marc BF

Reputation: 119

Finally, this made it for me. Chunk options apparently matter a lot, thanks for the feedback :). I am posting the final version, which gets a beautiful and better result.

{r echo = FALSE, results = 'hold'}
kable(func, format = "html", col.names = c("Point Name", "CFU count"), caption="Number of samples with 1 CFU grouped by point")%>%
kable_styling(bootstrap_options = c("striped", "hover"))

Upvotes: 1

Hao
Hao

Reputation: 7826

Also, here is a trick I learned from yihui. I assume you know the doc site for kableExtra.

https://haozhu233.github.io/kableExtra/awesome_table_in_html.html

If you replace the last ".html" with ".Rmd". You will get the rmarkdown file for this document.

Upvotes: 0

Related Questions