Home > Blockchain >  Table Gets Cut Off When Knitting to PDF
Table Gets Cut Off When Knitting to PDF

Time:01-24

I am in the process of creating a table 1 for my work, but when I knit my R Markdown file to PDF, some of the table gets cut off. Can I modify my code to either knit it landscape or not have half the table cut off?

  table_1 <- CreateTableOne(
  vars = vars,
  data = Cambodia,
  factorVars = fvars,
  test = FALSE,
)


tab1 <- kable(
  print(table_1,
        showAllLevels = TRUE,
        printToggle = FALSE,
        noSpaces = TRUE,
        catDigits = 1,
        contDigits = 1),
  caption = paste(
    "Baseline Characteristics of xyz."
  )
)
print(tab1)

CodePudding user response:

You can use kable_styling from the kableExtra package. The option would be latex_options="scale_down". You can use font sizes as well, please see https://haozhu233.github.io/kableExtra/awesome_table_in_pdf.pdf

  •  Tags:  
  • Related