Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

latex - Formatting export_summs in R Markdown?

I'm new to R Markdown and relatively new to R as a whole. I've been trying to write a short term paper in R Markdown and embed plots and regression tables. For the regression table, I'm using the export_summs function from the jtools package.

When knitting to html, there are no issues, but with knitting to PDF, while the table renders normally, but the text below (p values and such) is longer than the table itself, causing the last column to appear ridiculously elongated (picture below). It gets even worse if I try to change the document font size.

export_summs table screenshot

I am using pdflscape to rotate the pages with regression tables:

header-includes:
- usepackage{pdflscape}
- 
ewcommand{landscape}{egin{landscape}}
- 
ewcommand{elandscape}{end{landscape}}
output:
  pdf_document: default

And this is the code for export_summs:

```{r, echo=FALSE, message=FALSE, warning=FALSE, results='asis'}

export_summs(test15a, test15b, test15h, test15c, test15agr, test15e, test15f, scale=T, robust=T, 
             model.names = c("(1)", "(2)", "(3)", "(4)", "(5)", "(6)", "(7)"), 
             coefs=c("Constant" = "(Intercept)", "Unemployment" = "unemployment", "Monthly Earnings" = "monthly_earnings", 
                     "Religiosity" = "religion", "Primary Sector Worker Share" = "prim_employed"))
```

Is there some way to instruct the export_summs function to break the text below the table? Alternatively, can I at least get it to make all columns the same width?

Like I said, I'm not all that experienced and this genuinely has me at a loss.

question from:https://stackoverflow.com/questions/65836641/formatting-export-summs-in-r-markdown

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...