I recently discovered R package modelsummary
from answer to this question. It appears that the output of summary table created by modelsummary
can be of class kable_knitr
which can be fed into other functions from kableExtra
, such as kable_styling
.
However, I am stuck at how to specify values for other options from the function kable()
into the modelsummary()
function. One obvious way could be to get a data.frame
output and than input that into kable
. Is there a better alternative (so that I can avoid fixing the data.frame
output?
I am particularly looking for kable()
options, escape=F
(to insert greek letters in latex output - see this) and booktabs=T
.
A reproducable example:
x=rnorm(100)
mod1=arima(x,order = c(1,0,1))
modelsummary(mod1, output = 'kableExtra', coef_rename = c('ar1'='$x_{t-1}$',
'ma1'='$\\epsilon_{t-1}$')) %>%
kable_styling(latex_options = 'HOLD_position')
In the above table, I am trying to rename the variables to math style, which would work in kable()
if the names were given as they have been.