Question about Sizing Tables in Rmarkdown to PDF

So still fairly new to R and Rmarkdown and am having a little trouble when I knit a table to a PDF. The table expands beyond the margins of the page because the text doesn't wrap. Any help would be appreciated.

The data for the table can be found here: https://raw.githubusercontent.com/drchrisd/gradrates/master/Variables.csv

I used the following code:

variables %>% 
    knitr::kable(booktabs=T, caption = "College Graduation Dataset Variables & Definitions")

Produced this table

I think you could find kableExtra package useful here
https://haozhu233.github.io/kableExtra/

It will complement the knitr::kable function.

See the pdf vignette and the Latex Option scale_down page 7

Hope it helps

Thank you @cderv for your help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.