Scale down gt table for R Markdown PDF

This is a very general question. I created a few tables in an R markdown using the gt package. I was wondering how to scale down the table so it fits into the PDF created when I knit the markdown script. I have the following code for the table:

DEGs %>%
  filter(FC==2 & package=="edgeR") %>%
  select(-Dataset_label, -FC, -FDR, -Condition_1, -Condition_2, -package, -FullGeneBody.Down_genes, -FullGeneBody.Up_genes) %>%
  gt() %>%
  tab_options(
    container.width = pct(85),
    container.overflow.x = T,
    table.align = "center",
    table.width = pct(85),
    table.layout = "auto"
  )%>%
  tab_header(
    title = "DEHP and Pb 5 Month ",
    subtitle = glue("|FC| > {DEGs$FC[5]} and FDR < {DEGs$FDR[5]}")
  ) %>%
  fmt_number(
    columns = comparison
  ) %>%
  #fmt(
    #columns = c(Condition_Name_1, Condition_Name_2, Condition_1_GM_Numbers, Condition_2_GM_Numbers)
    
  #)%>%
  fmt_number(
    columns = c(ExonCollapsed.Down_genes, ExonCollapsed.Up_genes)
    
  ) %>%
  cols_label(
    comparison="Comp", 
    Condition_Name_1="Condition 1", 
    Condition_Name_2="Condition 2",
    Condition_1_GM_Numbers="Condition 1 #s", 
    Condition_2_GM_Numbers="Condition 2 #s", 
    ExonCollapsed.Down_genes="Down Genes", 
    ExonCollapsed.Up_genes="Up Genes"
    )

As you can see I tried using table.align, table.width etc. to try to resize the table, but none those settings seem to affect the table in the actual PDF.

Thanks for the help.



from Recent Questions - Stack Overflow https://ift.tt/3vp3a3P
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)