You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to share a potential issue with you as I have tried to circumvent it in several ways without any success. In a nutshell, the escape=FALSE option for modelsummary seems to ignore the titles of panels when using rbind or rcollapse, that keep to be escaped in case of latex content in there.
Here is a minimal reproducible example with mtcars:
library(modelsummary)
library(fixest)
# regression with fixest packagereg<-fixest::feols(
c(mpg, hp) ~ sw(log(qsec), log(drat)) |gear+vs, data=mtcars
)
# grep panels panels_reg<-list(
"Panel A. $\\log(qsec)_{gt}"=reg[grepl("qsec", names(reg))],
"Panel B. $\\Delta(drat)_{gt}"=reg[grepl("qsec", names(reg))]
)
# some latex math mode for the coefficients coef_labels_reg<- rep(
"$\\log({SO_{X}})_{g} \\times Post_{t}$",
length(panels_reg[[1]])
)
names(coef_labels_reg) <- c("log(qsec)", "(logdrat)")
# adding some rows at the end (these are not escaped)rows_reg<- tibble(
a= c("\\hspace{1em}Gear FE", rep("$\\checkmark$", 2)),
b= c("\\hspace{1em}VS FE", rep("$\\checkmark$", 2))
)
rows_reg<-data.frame(t(rows_reg))
# run modelsummary with `escape=FALSE` option onmodelsummary::modelsummary(
panels_reg,
output="latex_tabular",
coef_map=coef_labels_reg,
shape="rbind",
stars= c("*"=0.1, "**"=0.05, "***"=0.01),
col.names=NULL,
add_rows=rows_reg,
escape=FALSE
)
Hi!
I would like to share a potential issue with you as I have tried to circumvent it in several ways without any success. In a nutshell, the
escape=FALSE
option formodelsummary
seems to ignore the titles of panels when usingrbind
orrcollapse
, that keep to be escaped in case of latex content in there.Here is a minimal reproducible example with
mtcars
:Here is my
sessionInfo()
output:I hope it is relevant! Or if it is not, please let me know whether I am doing something wrong :)
The text was updated successfully, but these errors were encountered: