Row height in regression models with jtools in R Markdown

165 views Asked by At

I would like to adjust the row padding in a jtools regression table. I tried set_row_height since I read that the underlying structure is a huxtable. But I'm unsure, and it didn't work.

---
title: "Untitled"
author: "Name"
date: "10 5 2021"
output: html_document
---

## R Markdown

```{r, warning=FALSE, message=FALSE}
mymodel <- lm(mpg ~ ., data=mtcars)

library(tidyverse)
library(jtools)
library(huxtable)

export_summs(mymodel, scale = TRUE) %>%
  set_font_size(6) %>%  # working in markdown html
  set_row_height(., everywhere, 0.1)  # not working in html
```

It looks fine in RStudio, but uses extensive row space in Markdown. set_font_size is working, but set_row_height not.

enter image description here

1

There are 1 answers

0
Marco On BEST ANSWER

Finally, row height adjustment worked with set_tb_padding. I cannot replicate why it didn't worked in the first place. set_row_height requires CSS/LaTeX values, i.e. set_row_height("4cm"). I cannot reduce row height to a resonable size but can increase row height.


title: "Jtools and Huxtable"
author: "Name"
date: "10 5 2021"
output: html_document
---

## R Markdown

```{r, warning=FALSE, message=FALSE}
mymodel <- lm(mpg ~ ., data=mtcars)

library(tidyverse)
library(jtools)
library(huxtable)

export_summs(mymodel, scale = TRUE) %>%
  set_font_size(10) %>% 
  set_tb_padding(1)
```

enter image description here